Thursday, October 27, 2011

Jquery factory function

the $() function remove the need to do a for loop to acces a group of lelement since whatever we put nside the parenthese will be looped through automatically end store as a jQuery objec,we cn put just about anything inside the parenthese of the $(),here are few examples
A tag name: $('p') gets all paragraphs in the document.
An ID: $('#some-id') gets the single element in the document that has the
corresponding some-id ID.
A class: $('.some-class') gets all elements in the document that have a
class of some-class.

In jQuery, the dollar sign $ is simply shorthand for jQuery

No comments:

Post a Comment