jQuery Callback Function
What is jQuery Callback Function

JavaScript execute line by line, so effect is not finished and JavaScript code can be run.So overcome this problem jQuery introduce new concept of callback function, In the jQuery a callback function run when effect is finish.


Syntax to create callback function:


Example for jQuery Callback



<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>




        $("p").slideToggle("10000", function(){

            alert("The is callback function");







<button>Click Here</button>

<p>This is a paragraph with little content.</p>