Friday 29 June 2012

How To Use Confirm Box In Javascript

Copy And Paste . . . Enjoy
<html>
<head>
<script type="text/javascript">
function con() {
var answer = confirm("Do You Wanna Leave kamal World?")
if (answer){
alert("Bye bye!")
window.location = "http://www.google.com/";
}
else{
alert("Thanks for sticking around!")
}
}
</script>
</head>
<body>
<form>
<input type="button" onclick="con()" value="Kamal site">
</form>
</body>
</html>

No comments:

Post a Comment