jQuery and jQuery UI > jQuery Syntax |
jQuery syntax was designed to allow developers to easily select HTML element(s) and then perform some action on the element(s). The rudimentary syntax is as follows:
$(selector).action()
$
references jQuery; (selector)
queries the HTML element or elements; and .action()
performs an action on the element.
Examples of jQuery syntax:
$(this).hide()
: Hides the current element.$(“p”).hide()
: Hides all paragraphs.$(“p.wow”).hide()
: Hides all paragraphs of the class “wow”.$(“#wow”).hide()
: Hides an element with the id of “wow”.