document.addEventListener("DOMContentLoaded", function() { // code });
// jQuery document ready $(document).ready(function() { });
// A $( document ).ready() block. $( document ).ready(function() { console.log( "ready!" ); });
$( document ).ready(function() { console.log( "ready!" ); });
// A jQuery( document ).ready() block. jQuery( document ).ready(function() { console.log( "ready!" ); });
document.addEventListener("DOMContentLoaded", function(event) { //we ready baby });
$(document).ready(function(){ $("button").click(function(){ $("p").slideToggle(); }); });
<!doctype html> <html> <head> </head> <body> Your HTML here <script> // self executing function here (function() { // your page initialization code here // the DOM will be available here })(); </script> </body> </html>