Code for Adding Message and Confirmation Boxes Using
JavaScript?



Code for Adding Message and Confirmation Boxes Using JavaScript?..

Answer / 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

More JavaScript Code Interview Questions

how to pass data between pages using URLs

1 Answers   Symantec,


code to set the main window's size

0 Answers  


determine which Element received an Event

0 Answers  


how to Scroll a DIV content

0 Answers   SoftSquare,


code to create a new window

0 Answers  






Reading which Non-Character Key was pressed

0 Answers  


program that will accept any name and will be stored in an array

2 Answers  


how to pass data between pages using Cookies

0 Answers  


Create a ViewState Property?

0 Answers   TCS,


how to delay a function call ?

1 Answers  


how to Auto Scroll the page

0 Answers   Ninestars,


code to calculate the number of days between two dates

2 Answers  


Categories
  • PHP Code Interview Questions PHP Code (33)
  • JSP Code Interview Questions JSP Code (6)
  • ASP Code Interview Questions ASP Code (5)
  • CGI Perl Code Interview Questions CGI Perl Code (3)
  • JavaScript Code Interview Questions JavaScript Code (63)
  • VB Script Code Interview Questions VB Script Code (20)
  • Shell Script Code Interview Questions Shell Script Code (31)
  • Python Code Interview Questions Python Code (34)
  • WinRunner Code Interview Questions WinRunner Code (1)
  • HTML DHTML XHTML Code Interview Questions HTML DHTML XHTML Code (13)
  • XML Interview Questions XML (43)
  • Scripts_Markup Code AllOther Interview Questions Scripts_Markup Code AllOther (5)