jquery add document ready function in function code example Example: document ready $( document ).ready(function() { console.log( "ready!" ); });