Confirm's JavaScript function is very similar to the Javascript alarm function. A dialog box pops up and appears on the previous page, the current focus. The confirm box contains different warning boxes. It provides the user's choice. They can pop up with confirm according to the confirmation, or cancel or disagree with the pop-up requirements.
Confirm is the most often used for confirm an important action and is happening on a website. For example, they may be used to submit commands by confirm or inform passengers that they click the link to take them to another website.
For example, confirm of JavaScript
The following is an example. It indicates that you will use a confirm dialog box to warn users about things so that they can either choose to continue or remain unchanged.
<HTML>
<Head>
<SCRIPT type = "text/JavaScript">
<! --
Function confirmation (){
VaR answer = confirm ("Leave 111cn.cn? ")
If (answer ){
Alert ("Bye bye! ")
Window. Location = http://www.111cn.cn;
}
Else {
Alert ("thanks for sticking around! ")
}
}
// -->
</SCRIPT>
</Head>
<Body>
<Form>
<Input type = "button" onclick = "Confirmation ()" value = "Leave tizag.com">
</Form>
</Body>
</Html>