1// A $( document ).ready() block.
2$( document ).ready(function() {
3 console.log( "ready!" );
4});
5
1// without jQuery (doesn't work in older IEs)
2document.addEventListener('DOMContentLoaded', function(){
3 // your code goes here
4}, false);
5
1$(document).ready(function(){
2 $("button").click(function(){
3 $("p").slideToggle();
4 });
5});