jQuery Note

jQuery Syntax

The jQuery syntax is tailor-made for selecting HTML elements and performing some action on the element(s).

$ (selector) . action()

  • A $ sign to define/access jQuery
  • A (selector) to “query (or find)” HTML elements
  • A jQuery action() to be performed on the element(s)

 $ (“p”) . hide() – hides all <p> elements.

The $(document).ready() method allows us to execute a function when the document is fully loaded.