jQuery Syntax is a client-side syntax highlighter, dynamically loads external dependencies javascript and css. It uses jQuery to make it cross-browser compatible and make integration easier with other systems.
$(document).ready(function(){ // jQuery methods go here... });
This document is loading. It prevents jQuery code because it cannot run before the document is finished or in other words it is not ready.
So it is better that you wait for some time. You have to wait till the document load is completed and before you are ready to work on it. Also, this time you will be allowed javascript code.
Example
$(“.example”).hide()
Hides all elements with class=”example”.
$(“p”).hide()
The jQuery hide() function, hiding all <p> elements.
$(“#example”).hide()
Hides the element with id=”example”.
$(“.div1”).hide()
The jQuery hide() function, hiding whose class=”.div1″ in the elements.