bom-对话框

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <input type="button" value="alert" id="btn1">
  <input type="button" value="prompt" id="btn2">
  <input type="button" value="confirm" id="btn3">

  <script>
    var btn1 = document.getElementById('btn1');
    var btn2 = document.getElementById('btn2');
    var btn3 = document.getElementById('btn3');

    btn1.onclick = function () {
      alert('hello world');
    }

    btn2.onclick = function () {
      // 弹出提示,让用户输入内容
      var userName = prompt('请输入姓名', '张三');
      console.log(userName);
    }

    btn3.onclick = function () {
      var isSure = confirm('是否要删除数据?');
      console.log(isSure);
    }



  </script>
</body>
</html>

 

上一篇:Andorid 多线程(三):Handler 消息传递机制


下一篇:[Swift通天遁地]六、智能布局-(6)其他几种约束关系:父视图/Corner/Edge/AnchorAndFillEdge