The jQuery library contains the following features:
- HTML element selections and manipulations
- CSS manipulation
- HTML event functions
- JavaScript Effects and animations
- HTML DOM traversal and modification
- AJAX
The jQuery library is stored as a single JavaScript file, containing all the jQuery methods.
It can be added to a web page with the following mark-up:
<head>
<script type="text/javascript" src="jquery.js"></script>
</head>
Please note that the <script> tag should be inside the page's <head> section.
jQuery syntax :
Basic syntax is: $(selector).action()
- A dollar sign to define jQuery
- A (selector) to "query (or find)" HTML elements
- A jQuery action() to be performed on the element(s)
$(this).hide() - hides current element
$("p").hide() - hides all paragraphs
$("p.test").hide() - hides all paragraphs with class="test"
$("#test").hide() - hides the element with id="test"
$("p").css("background-color","yellow");
jQuery Events
Here are some examples of event methods in jQuery:
$(document).ready(function) Binds a function to the ready event of a document
(when the document is finished loading)
$(selector).click(function) Triggers, or binds a function to the click event of selected elements
$(selector).dblclick(function) Triggers, or binds a function to the double click event of selected elements
$(selector).focus(function) Triggers, or binds a function to the focus event of selected elements
$(selector).mouseover(function) Triggers, or binds a function to the mouseover event of selected
JQuery updates and downloads :
jQuery.com has all the updates. JQuery is available in two flavors Minified (for production) and Uncompressed (for development and testing). Current version of JQuery is 1.6.2. We can download JQuery file and place it on our application folder and just mark a reference to JQuery file within the html file to make it work.
If you don't want to download JQuery, you can directly use hosted JQuery library from Google or Microsoft CDN.

Sachin KumarPosted Nov 10, 2016, 12:02 AM
Nice Article.Easiest way to understand how JQuery works.Thanks.
Chad MusgrovePosted Sep 7, 2011, 11:36 AM
Thank you for this simple explanation of JQuery. As a self taught web developer, I have been using Jquery plugins, but often have desired to modify small things about the plug in itself. By their nature, most of the plugins are licensed under a GPL, allowing me to do just that, but I don't understand a lot about the actual code that makes the plugins work. This is a good explanation that points me in the right direction. Thanks, Chad