jQuery·jQuery from selection to migration

Why jQuery exists

Understand the problems jQuery solved and the problems it did not.

Beginner 11 min read Lesson 1 of 300 Challenge included
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.

basics.jsJavaScript
const buttons = document.querySelectorAll('button')
buttons.forEach((button) => button.addEventListener('click', () => console.log('clicked')))
Your turn

Select without jQuery

Easy

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 in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Selection and chaining
Lesson 1 of 300 · 0% of course