Category Archives: jQuery

1) jQuery Explained

HTML document traversal & manipulation, event handling, animation, and Ajax are simpler by using the APIs in the jQuery library.

Designed to work across a multitude of browsers.

Document Object Model, or DOM

The DOM is a tree structure with the HTML document as the root object. The root can have several children, and those children can have several children. For example, a web page that contains a list would have a root object, with a child list object that contained several child list element objects.

JavaScript and jQuery enable you to interact directly with the DOM, reading each of the objects, changing those objects, and even removing and adding objects.

jQuery Syntax

The jQuery syntax is made for selecting HTML elements and performing some action on the element(s).

Basic syntax is: $(selector).action()

  • $ sign to define and access jQuery
  • (selector) to query or find the HTML element(s)
  • action() to be performed on the HTML element(s)


  • $(this).hide() – hides the current element
  • $(“p”).hide() – hides all <p> elements
  • $(“.test”).hide() – hides all elements with class=”test”
  • $(“#test”).hide() – hides the element with id=”test”


5) Light Bulb