jQuery fadeTo()

The opacity to which the selected element should fade out of visibility can also be controlled in jQuery. The fadeTo() method allows the fading of an element to a desired opacity. Example: <!DOCTYPE html> <html> <head> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script> <script> $(document).ready(function(){ $(“button”).click(function(){ $(“#div1”).fadeTo(“fast”,0.15); }); }); </script> </head> <body> <p>Click to fade me out upto 0.15 opacity.</p> … Read more