Sunday, January 12, 2014

Window object 2) confirm()

confirm() displays the confirm dialog box containing message with ok and cancel button.

<html>  
<head>  
<script type="text/javascript">  
function msg()
{  
var m=confirm("Are u sure?");  
if(m==true)
{  
alert("Good");  
}  
else
{  
alert("As you wish");  
}
}  
</script>  
</head>  
<body> 
<input type="button" value="delete record" onclick="msg()"/>  
</body>  
</html>  

No comments:

Post a Comment