jQueryWeb DevelopmentFront End Technology

The fadeout() method in jQuery is used to give a fading effect by changing the opacity for the selected elements. The fading effect changes from visible to hidden.

Syntax

The syntax is as follows −

$(selector).fadeOut(speed,easing,callback) Above, the parameter speed is the speed of the fading effect. Here, easing is the speed of the element in different points of the animation, whereas callback is a function to be executed after fadeOut() completes. Example Let us now see an example to implement the jQuery fadeout() method Live Demo <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script>$(document).ready(function(){
$("button").click(function(){$("h2").fadeOut();
});
});
</script>
<body>
</html>