JavaScript Beginner Dom · 1 min read

change event on select

Start the JavaScript learning path »

❮ JavaScript Home All Tutorials ❯

How do I detect dropdown changes?

change listener.

Example

Interactive preview available
JavaScript Example
const course = document.querySelector('#course');
course.addEventListener('change', () => {
  console.log('Selected:', course.value);
});

Line-by-Line Walkthrough

Useful for filters and cascading dropdowns.

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share

Reactions

Loading reactions…