Home >Web Front-end >JS Tutorial >How to write js to pop up a prompt message to confirm deletion
The first method: It is very easy to use. Only after confirmation can the download address page be opened. The principle is also relatively clear. Mainly used to confirm deletion of a single message.
function p_del() {
var msg = "Are you really sure you want to delete it?/n/nPlease confirm!";
if (confirm(msg)==true ){
return true;
}else{
return false;
}
}
Call method:
Second method: The principle is the same as above.
JavaScript deletion confirmation box
The third type: Mainly used for confirmation prompts for batch deletion
The following is compiled by other netizens, they are similar. Generally, a confirmation button pops up to determine whether to continue to the deletion page below.
First type:
Second Kind:
//Call
" onclick="javascript:del_sure()">Delete
Third option:
function confirmDel(str){
return confirm(str);
}
For more related articles on how to write js pop-up prompts to confirm deletion, please pay attention to PHP Chinese net!