jQuery TutorialLesson 4Free preview
jQuery Syntax
This lesson is part of jQuery · All levels
Summary
jQuery syntax always follows the $(selector) pattern: a function that contains a selector to select elements, followed by the method that implements the action. The dollar sign is a jQuery function, whereas the selector can be a tag name, a class, an id, or an attribute. Almost all jobs in jQuery follow this simple pattern, so once you understand the pattern you can be quick to master.
Key points
- The basic pattern: $(selector)
- $ is the abbreviation of jQuery
- The selector determines which elements to process
- Action is a method such as hide(), text(), addClass(), or animate()
- The method can accept optional parameters such as the speed of the effect or new values
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.