At the beginning of the first acquaintance with jquery's not selector, the function you want to implement is to click on the first Div, display the second Div, click outside the first div to hide the second div.
The specific code is as follows:
<!DOCTYPE HTML><HTML><Head><Scriptsrc= "Http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></Script><Script>$ (document). Ready (function(){ $("#btn"). Click (function(){ $("#holder"). Toggle (); }); $(": Not (#btn)"). MouseUp (function(){ $("#holder"). Hide (); });});</Script></Head><Body><H1>Welcome to My homepage</H1><DivID= "BTN"style= "Cursor:pointer;">I'm the button.</Div><DivID= "Holder"style= "Background-color:lightblue;"><P>I live in Duckburg.</P><P>My best friend is Mickey.</P></Div></Body></HTML>
It is important to note that both cannot trigger the Click event at the same time; Div1 called the Toggle () method cannot be hidden, only call show ().