Fade To Method in JQuery| Tryit Editor for Web Development
Edit This Code:
See Result »
<html> <body> <h1>Welcome To T4-Tutorials</h1> <h2>Fade To 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").fadeTo("slow", 0.20); $("#T2").fadeTo("slow", 0.12); $("#T3").fadeTo("slow", 0.10); }); }); </script> </head> <body> <button>Click to Fade boxes</button><br><br> <div id="T1" style="width:100px;height:100px;background-color:green;"></div><br> <div id="T2" style="width:100px;height:100px;background-color:gray;"></div><br> <div id="T3" style="width:100px;height:100px;background-color:purple;"></div> </body> </html>
Result: