Don't say much nonsense, put the code first, then explain
<script>$ (document). Ready (function () {$ ("Button"). Click (function () {$ ("#div1"). Fadetoggle (); $("#div2"). Fadetoggle ("Slow"); $("#div3"). Fadetoggle ( the); }); }); </script><p> demonstrates the Fadetoggle () method with different parameters. </p><button> Click here to make three rectangles fade </button><br><br><div id="Div1"style="width:80px;height:80px;background-color:red;"></div><br><div id="Div2"style="Width:80px;height:80px;background-color:green;"></div><br><div id="Div3"style="Width:80px;height:80px;background-color:blue;"></div>
Key points (Tips):
1,$ ("button"). Click({
});
This is the key to selecting the Click event Corresponding button and the error cannot occur.
2,$ ("#div1"). Fadetoggle ();
This is the process of selecting the node and calling the function
The other is your HTML code, note the node ID or Class settings
Today remains the "click Fade Event" of JQ click events