Home > Web Front-end > JS Tutorial > javascript window.confirm confirmation cancel dialog box implementation code summary_javascript skills

javascript window.confirm confirmation cancel dialog box implementation code summary_javascript skills

WBOY
Release: 2016-05-16 17:48:54
Original
1781 people have browsed it

confirm() method
The confirm() method is used to display a dialog box with the specified message and OK and Cancel buttons.
Description: confirm() returns true if the user clicks the OK button. If the cancel button is clicked, confirm() returns false

A:

Copy code The code is as follows:

Two types:
Copy code The code is as follows:


< ;a href="Delete.aspx" onClick="delete_confirm">Delete

Three types:
Copy Code The code is as follows:

if(window.confirm('Are you sure you want to cancel the transaction?')){
//alert("OK" );
return true;
}else{
//alert("Cancel");
return false;
}

Four kinds:
Copy code The code is as follows:



A simpler method that I often use

, simpler:
Copy the code The code is as follows:


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template