JavaScript confirm function is similar to the JavaScript alert function, where a small dialogue box displays by popping up in front of the web page currently in focus. The confirm box is however, supplies the user with a number choice to chose from. They can click OK to confirm or they can press cancel.
Confirmation are usually used to confirm any important actions that will take place on a website.
Ex.
<html>
<head>
<script type="text/javascript">
function confirmation() {
var answer = confirm("Leave ThisSite.com?")
if (answer){
alert("See you soon!")
window.location = "http://www.google.com/";
}
else{
alert("Stay Around!")
}
}
</script>
</head>
<body>
<form>
<input type="button" onclick="confirmation()" value="Leave This website.com">
</form>
</body>
</html>
JavaScript Confirm
JavaScript confirm function is similar to the JavaScript alert function, where a small dialogue box displays...
javascript confirm
&nsbp;
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users