Wednesday, November 26, 2008

jQuery notes

Looking into jQuery. Some of my notes as I go...

It is interesting to note that for the $() function, it removes the need to do a for loop to access a group of elements since whatever put inside the parentheses will be looped through automatically and stored as a jQuery object.

Common examples on using the $() factory function:

Element Sample jQuery Meaning
tag name $('p') gets all paragraphs in the document.
id $('#some-id') gets the single element in the document that has the corresponding some-id ID.
class $('.some-class') gets all elements in the document that have a class of some-class.