document ready jquery

JavaScript
// A $( document ).ready() block.
$( document ).ready(function() {
    console.log( "ready!" );
});
// A jQuery( document ).ready() block.
jQuery( document ).ready(function() {
    console.log( "ready!" );
});  
    $(document).ready(function(){
  $("button").click(function(){
    $("p").slideToggle();
  });
 });
  
 $( document ).ready(function() {
    console.log( "ready!" );
});
$( document ).ready(function() {
    console.log( "ready!" );
});document.addEventListener("DOMContentLoaded", function(event) { 
  //we ready baby
});
Source

Also in JavaScript: