Final quiz · Results
You passed
80%
check_circlePassed
4 of 5 right. The pass mark is 70%.
Your answers
- check_circleQuestion 1 · RightWhich method returns the first element that matches a CSS selector?
- Your answer:
- querySelector()
querySelector() takes any CSS selector and returns the first match, or null. querySelectorAll() returns every match.
- cancelQuestion 2 · Not quiteWhich of these events bubble up to parent elements?
- Your answer:
- click, keydown, focus
- Right answer:
- click, keydown
click and keydown bubble. focus and mouseenter don't; use focusin and mouseover when a parent needs to hear them.
- check_circleQuestion 3 · RightsetTimeout(fn, 0) runs fn before the next line of code.
- Your answer:
- False
Even with a delay of zero, the callback waits in the queue until the code running now has finished. The next line runs first.
- check_circleQuestion 4 · RightWith event delegation, where do you attach the listener?
- Your answer:
- On a parent of the children
One listener on a parent hears events from all of its children, including children added later, through bubbling.
- check_circleQuestion 5 · RightWhat does new FormData(form) collect?
- Your answer:
- The named fields and their values
FormData collects each named, enabled field and its current value, the same set the browser would send.