jquery is inseparable from JavaScript, and the chain of events is essential.
The following examples refer to the "jquery authoritative guide"
A framework element is defined in the CSS that contains the title and content. and set the content to initially not be visible.
When the user clicks an element with the class name called "title", it adds a style named "Control" itself, and the next class name is called the "content" element.
You can see the implementation of the two functions through the "." Symbols are connected together.
1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title></title>6<style type= "Text/css" >7. iframe{border:solid 1px #888; font-size:13px;}8. title{padding:6px;background-color: #EEE;}9. content{padding:8px 0px;font-size:12px;text-Align:center;display:none;}Ten. curcul{background-color: #CCC;} One</style> A -<body> -<div class= "title" > title </div> the<div class= "Content" ></div> - -<script src= "Script/jquery-2.0.3.js" ></script> -<script type= "Text/javascript" > + //$ (document). Ready (function () { - //$ ("div"). html ("Hello World"); + // }); A$(function(){ at$ (". Content"). HTML ("Hell wordl")); -$ (". Title"). Click (function(){ -$( This). addclass ("Curcul"). Next (". Content"). CSS ("Display", "block"); - }); - }); -</script> in</body> -View CodeA chained notation of jquery events