use of document.ready function in jquery code example
Example 1: document ready javascript
$(document).ready(function(){
$("button").click(function(){
$("p").slideToggle();
});
});
Example 2: document ready jquery
$(function() {
// Handler for .ready() called.
});