Home  >  jQuery

Example of callbacks in jQuery

December 12, 2012
Callbacks function is used in jQuery for multipurpose task at one time. Callbacks function is executed after current task is done. Callback function is created in another function.
Syntax - $(selector).show(speed,callback);
<!DOCTYPE html>
<script src="jquery.js"></script>
<p>This is callback example</p>
<div id="callBack" style="display:none">This is callback function</div>
According to example when click on hide button, hide() function is executed and p element is hide, after hide function executed show function is executed and show the div element. Callback function is declare in hide function.

©2022 concretepage.com | Privacy Policy | Contact Us