Code for Adding Message and Confirmation Boxes Using
JavaScript?
Answer Posted / sivasubramanian.k
<html>
<head>
<script>
function message()
{
var str;
str="Click Ok to continue!!!";
alert(str);
}
function confirmation()
{
var str;
str="Are you sure to delete?Then click Ok or Cancel!!!";
confirm(str);
}
</script>
</head>
<body>
<form>
<h3>Click the button below which shows message box</h3>
<input type="submit" value="Click Me" name="submit"
onClick="return message()">
<h3>Click the button below which shows confirmation box</h3>
<input type="submit" value="Delete" name="delete"
onClick="return confirmation()">
</form>
</body>
</html>
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
write a code to generate pseudorandom numbes
how to create Expandable and Collapsible Menus
how to create a Custom Scrollbar
code to detect versions of different browsers like internet explorer, netscape, mozilla, opera etc
Reading which Non-Character Key was pressed
code to get the coordinates of a Click Event
How to encode and decode URL strings?
how to create a Draggable element
How to block double clicks
Code to Block submission of form by pressing Enter Key
code to images to rollover
code to set the main window's size
function to combine two or more arrays
code to keep a page Out of the browser history
write a code that user can choose/alter Body Text Size