Why jQuery exists
Understand the problems jQuery solved and the problems it did not.
What you will be able to do
- jQuery wraps DOM nodes in a collection object.
- It provides chaining and cross-browser helpers.
- Modern browsers cover most of its original value.
- Read it well; prefer platform APIs for new code.
In plain English
jQuery normalised DOM selection and events across old browsers. Modern browsers now provide querySelector, classList, fetch and addEventListener, so new code rarely needs it. Existing code still needs people who can read it.
const buttons = document.querySelectorAll('button')
buttons.forEach((button) => button.addEventListener('click', () => console.log('clicked')))Your turn
EasySelect without jQuery
Add a click listener to every .js-save button using modern DOM APIs.
JAVASCRIPT · starter
document.querySelectorAll('.js-save')Check your understanding before moving on.
Knowledge checkQuestion 1
Which modern API replaces most jQuery selection?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.