Fade Toggle Method in JQuery| Tryit Editor for Web Development
Edit This Code:
See Result »
<html> <body> <h1>Welcome To T4-Tutorials</h1> <h2>Fade Toggle Method:</h2> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("#T1").fadeToggle(); $("#T2").fadeToggle("slow"); $("#T3").fadeToggle(3300); }); }); </script> </head> <body> <button>Click to Fade in or out boxes</button><br><br> <div id="T1" style="width:100px;height:100px;background-color:yellow;"></div> <br> <div id="T2" style="width:100px;height:100px;background-color:purple;"></div> <br> <div id="T3" style="width:100px;height:100px;background-color:lightgray;"></div> </body> </html>
Result: