1-3y

DOM Events and Event Delegation

When you click a child element, the event can move up to parents. Event delegation uses one parent listener to handle many children.

Analogy

Instead of giving every student a separate bell, the class monitor listens once and checks which student raised a hand.

Follow-up questions

Topic practice prompts

What is event delegation and why is it useful?

Event delegation puts one listener on a parent and handles child interactions by checking the event target.

  • What is the difference between target and currentTarget?
  • Which events do not bubble the way you expect?
Cheat sheet

Last-day revision lines

  • target is origin.
  • currentTarget is where the listener sits.
  • Delegation reduces listener count.
  • Check semantics and keyboard access too.
Source references
  • JS interview preparation: context/JS Interview Preparation Questions.docx
  • HTML CSS interview questions: context/HTML CSS interview question.docx
Offline study support

Local resource packs for this topic

1 local packs

Use these local packs when you want broader official-source context without leaving the app.

javascriptRuntime, closures, and async behavior

JavaScript Runtime and Closures

A local offline guide to the JavaScript runtime ideas interviewers repeatedly use for JS and browser rounds.

JavaScriptBrowser and DOM

Closures, lexical scope, event loop, microtasks, timers, promise ordering, and DOM callback behavior.

Open local study pack
Next step

Related topics to study after this one

Accessibility3-6y

HTML, CSS, and Accessibility Foundations

Explain semantics, keyboard support, focus, labels, and contrast like a product engineer.

Simple mode, interview mode, example, pitfalls, and follow-ups are all inside this topic.

accessibilitysemantic-htmlformskeyboard
Study topic
Machine Coding3-6y

Machine Coding Round Approach

Show how to scope, structure, and narrate your work in the practical frontend round.

Simple mode, interview mode, example, pitfalls, and follow-ups are all inside this topic.

machine-codingcomponent-designcommunicationtime-management
Study topic