Double-click event in Web page

Source: Internet
Author: User

1 <!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">2 <HTMLxmlns= "http://www.w3.org/1999/xhtml">3 <Head>4     <title></title>5     <Scriptsrc= "Scripts/jquery-1.4.1.js"type= "Text/javascript"></Script>6     <styletype= "Text/css">7         *{margin:0px;padding:0px;}8 Body{font-size:12px;}9         Ten . Box{margin:10px;padding:10px;} One . Box H3{margin:10px 0px;Border-bottom:1px solid Red;Padding-bottom:10px;} A . Box P{Line-height:20px;} -          - #allbox{margin:10px;padding:10px;} the #allbox Div{Border:5px Solid #aaccff;Margin-top:10px;Height:50px;} -          -     </style> -     <Scripttype= "Text/javascript"> +         $(function(){ -            $("#allbox Div"). DblClick (function(){ +                //This refers to the object that is currently double-clicked A                //Pop-up dialog box, confirm when return True, Cancel return false, True when delete is performed at                varresult=Window.confirm ("are you sure you want to delete? "); -                if(Result==true){ -                $( This). Remove (); -                } -  -            }); in  -         }); to  +     </Script> -  the  * </Head> $ <Body>Panax Notoginseng     <Divclass= "box"> -         <H3>Test request</H3> the         <P> +1. When you double-click each sub div of Allbox, the div that you double-clicked is removed from the interface.<BR/> A 2. Pop Up confirmation dialog before deleting, confirm Delete the  +         </P> -     </Div> $  $     <DivID= "Allbox"> -         <Div>Box1</Div> -         <Div>Box2</Div> the         <Div>Box3</Div> -         <Div>Box4</Div>Wuyi         <Div>Box5</Div> the         <Div>Box6</Div> -     </Div> Wu  -  About </Body> $ </HTML>

Double-click event in Web page

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.