Alert Box
An alert box is used if you want to make sure information comes through to the user. When an alert box pops up, the user will have to click on "OK" to processed.
Syntax:
Example:
Preview:
Conform box
A conform box is used if you want the user to verify or accept something. When a conform box pops up, the user will have to click either "OK" or "Cancel" to processed. If the user clicks "OK" the box returns true. If the user clicks "Cancel", the box returns false.
Syntax:
Example:
r=confirm("Press a button");
if (r===true)
{
alert("You pressed OK!");
}
else
alert("You pressed Cancel");
}
Preview:
Prompt Box
Syntax:
Example:
name=prompt("Please enter your name", "Your Name");
if ((name!=null) && name!=" ")
{
alert("Hello "+name+"! How are you today?");
}
}
Preview:
Related Search Terms
Related Posts:
How To Create Simple Image Slideshow Using JavaScript ?
Image Slideshow with Navigation Buttons Using JavaScript
How to create Changeable Date and Time Using JavaScript?
How to Create JavaScript Image Slideshow with LInks
How to Display Date Format in JavaScript?
How to Validate a HTML Form Using JavaScript?
What are the Different Ways to Redirect Page in JavaScript?
How to Detect Visitor's Browser Using JavaScript?
How to make rounded corners border using CSS
How to Create Custom CSS Template for Printing
How to create a simple form using HTML?
إرسال تعليق
Click to see the code!
To insert emoticon you must added at least one space before the code.