JQuery Syntax

JQuery needs to select HTML elements to act upon.


  • $ defines to access mentioned HTML element.
  • (selector) finds HTML element where JQuery is to act.
  • action() defines JQuery action to be performed on selected HTML element.


$("div").hide()-Hides all the HTML div elements.

Document Ready

We use this method so that JQuery starts working only when entire web page has loaded.This because if one clicks a button but the action that is to be performed is not loaded on web page then what action will that do.


  • $(document).ready(function(){

JQuery Selectors

Selectors in JQuery are used to select mentioned or desired HTML element and to upon them to make them responsive.
<!DOCTYPE html>
<script src="https://ajax.googleapis.com
<div class="example">
This is DIV element.


This is DIV element.
Here JQuery first checks whether button is clicked or not and if button is clicked then it selects element with class example and hides that.