Skip to content
free
K
1
2
practice
Home
Math
English
Science
Social Studies
Contact
Language
English
Español
Sign In
/
High School Electives
/
Computer Science
/
JavaScript Events and the DOM
Grade Level
Computer Science
HSCS.193 JavaScript Events and the DOM
0%
Skill Level
🔴 Hard
00:00
Progress to Next Level
25% to Medium
Easy
Medium
Hard
Mastery
100%
A delegated listener should respond only when a card itself or one of its children is clicked, but not when the empty container background is clicked. Which check is best?
A
`const card = e.target.closest(".card"); if (!card) return;`
B
`if (e.type !== "card") return;`
C
`if (e.currentTarget.matches(".card")) return;`
D
`const card = document.querySelector(".card");`
Submit Answer