Methods of confirmation box pop-up before confirm implementation in js _ javascript tips-js tutorial

Source: Internet
Author: User
This article mainly introduces how confirm in js can pop up a confirmation box before executing the operation. It is a frequently used function for executing Delete and other operations and is of great practical value, for more information about how to use confirm in js, see the following example. Share it with you for your reference. The specific implementation method is as follows:

The confirmation prompt is displayed before deletion or other operations. We have many methods, the most basic of which is to use the confirm function provided by js to perform operations.

The simplest usage is as follows:

Use confirm for mouse events

The Code is as follows:

Click OK


You can also do this if you want to simply call it.

The Code is as follows:

Click OK


Click the hyperlink. If you click OK, the URL connected to the hyperlink is displayed. If you click Cancel, do not execute the hyperlink
Example.

The Code is as follows:

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.