*<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>*
I want to know what's the problem. It is not working but it is the same as in http://www.w3schools.com/js/js_popup.asp
confirm()
and it's in an infinite loop*
at the beginning and end of the documentwindow.confirm
</div>
in the <body>
http://jsfiddle.net/cvyyL/
<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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With