Click Delete Pop-up prompt to delete code:
In some applications, there will be delete functions, such as the deletion of news functions, in these features, when the click Delete, the general will pop up the prompt window, whether to delete the specified content, in order to prevent the phenomenon of misoperation, the following code example through the introduction, how to pop up this prompt window.
The code example is as follows:
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><Scripttype= "Text/javascript"> functiondel () {if(Confirm ("confirm the deletion?") {alert ("here to write the delete code"); } Else{alert ("do not delete") return; }} window.onload=function(){ varBT=document.getElementById ("BT"); Bt.onclick=function() {del (); }}</Script> </Head><Body><inputtype= "button"value= "Click to delete Related content"ID= "BT"/> </Body></HTML>
The above code. Click the Delete button to pop up the hint, the code is very simple, here is not more introduction.
Related reading:
The 1.confrim () function can be found in the the Confirm () method of the Window object a chapter.
2.onclick events can be found in the OnClick events section of JavaScript .
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=12194
For more information, refer to: http://www.softwhy.com/javascript/
Click Delete Pop-up prompt to delete code