Sir*_*der 4 html javascript confirm function
*<html>
<head>
<title>practise</title>
<script type="text/javascript">
function confirm() {
var r = confirm("Press the button");
if (r == true) {
alert("You are right");
} else {
alert("You are wrong");
}
}
</script>
</head>
<body>
<input type="button" name="submit" value="showtime" onclick="confirm()"/>
</div>
</body>
</html>*
Run Code Online (Sandbox Code Playgroud)
我想知道问题是什么.它不起作用,但它与http://www.w3schools.com/js/js_popup.asp中的相同
confirm(),它处于无限循环中*在文档的开头和结尾处有一个window.confirm</div>在<body><html>
<head>
<title>practise</title>
<script type="text/javascript">
function show_confirm() {
var r = confirm("Press the button");
if (r == true) {
alert("You are right");
} else {
alert("You are wrong");
}
}
</script>
</head>
<body>
<input type="button" name="submit" value="showtime" onclick="show_confirm()"/>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)