Jquery Philosophy
Jquery Philosophy
jQuery code begins $ followed by a selector and ends with actions(s). Selectors and actions can be attached to events.
$ - a jQuery Object $( ) - jQuery wrapper (single/double quotes) $(div) - Find Some Elements addClass(xyz) - Do something with them
Selecting using selectors - Just pass a selector to $() - Use any CSS selector Selecting By Id $(#header)
Using filters for selecting: Basic Filters Forms :input, :text, :submit, :password, .. :enabled, :disabled, :checked, .. :first, :last, :even, :odd, ... Content Filters: :empty , :contains(text), :has(selector), .. Attribute Filters: [attribute], [attribute=value], [attribute!=value], ..
Attributes
css(), addClass(), attr(), html(), val(), .. Events click(), bind(), unbind(), live(), .. Effects hide(), fadeOut(), toggle(), animate(), .. Ajax load(), get(), ajax(), getJSON(), ..