pav
9/9/2013 - 5:46 PM

The function jQuery() is the most important one in the jQuery library. You will almost always use it through the shortcut, $(). This functi

The function jQuery() is the most important one in the jQuery library. You will almost always use it through the shortcut, $().

This function has many uses, all of which return a jQuery object. The most simple use is to turn a regular javascript HTML element into a jQuery one.

The difference is that the jQuery object has all of the important jQuery methods that make jQuery so useful, whereas the javascript one does not.

//element is now a plain old javascript DOM element
var element = document.getElementById('myElement');

//make element a jQuery object
var $element=element;