window.confirm 网页提示栏,返回true或false

eg:

  1. <body>
  2. <script>
  3. var t = window.confirm("要不要")
  4. console.log(t) //true or false
  5. </script>
  6. </body>

window.prompt 输入型弹框

eg:

  1. <body>
  2. <script>
  3. var test =window.prompt("请输入","hello world"); //提示语,默认值
  4. console.log(test) //hello world
  5. </script>
  6. </body>