jQuery is optimized for easy DOM manipulation and allows method chaining by returning the jQuery object. This means that the [cci]jQuery[/cci] (or [cci]$[/cci] shorthand syntax) allows you to target DOM elements with CSS syntax.
You can select a paragraph with the id “dino” in jQuery:
Pretty easy, right? How does jQuery do this?
BigBinary has a great article walking through the process:
- If querySelectorAll works, use querySelectorAll.
- Else, use Sizzle.
To use [cci]querySelectorAll[/cci] instead of jQuery, you could use: