jQuery Effect fadeOut() Method

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.


The syntax is as follows −


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.


Let us now see an example to implement the jQuery fadeout() method 

 Live Demo

<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<h2>Demo Heading</h2>
<button>Click to Fade out</button>


This will produce the following output −

Click the button to fade out heading. Now, you can’t see the heading since it faded out i.e. from visible to hidden −

Updated on: 31-Dec-2019


Kickstart Your Career

Get certified by completing the course

Get Started