jQuery TutorialLesson 5Free preview
jQuery Selectors
This lesson is part of jQuery · All levels
Summary
The jQuery selector determines which elements a method will process. You can use tag names, class with dot marks, id with hash, attribute, to a combination of CSS selectors such as `div .kartu`. jQuery also provides special selectors that are not available in CSS, such as `:animated` or `:contains()`.
Key points
- Selectors are written in the $ function, e.g. $("p") and $(".kartu") (.kartu)
- The syntax of the selector follows the CSS selector rules, so the CSS knowledge is immediately useful.
- Selectors can be many elements at once.
- jQuery special selectors such as `:eq()`, `:contains()`, and `:animated` expand the selection capabilities
- Proper selection makes DOM manipulation more efficient and targeted.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.