首页 > 代码库 > JavaScript点击按钮显示 确认对话框

JavaScript点击按钮显示 确认对话框

//JavaScript点击按钮显示确认对话框<html xmlns="http://www.w3.org/1999/xhtml">  <head>  <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  <title>My First Script</title>  <script type="text/javascript">  function test() {      var result = confirm("Please make sure.");      if (result == true) {          alert("You choose YES! Great!");      } else {          alert("What a bitch you are !");      }  }  </script>  </head>  <body>      <input type="button" value="http://www.mamicode.com/Click Me!" onClick="test();" />  </body>  </html>