Click Delete Pop-up prompt to delete code

Source: Internet
Author: User

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

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.