Confirm of JavaScript

Source: Internet
Author: User

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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.