JavaScript · Lesson 105 of 138
DOM Quiz
Test yourself.
Time to check what you've learned about JavaScript in the browser. Pause after each question, and answer it before I do.

- DOM quiz
- Pause and think
- Then check
Question 1
Which method finds the first element matching a CSS selector? The answer is query selector.
Quick check
First element matching a selector?
Question 2
Which property safely sets plain text, without parsing tags? The answer is text content.
Quick check
Safe for user input?
Question 3
How do you stop a form from reloading the page when it's submitted? The answer is e dot prevent default.
Quick check
Stop the reload?
Question 4
What does local storage store? The answer is strings. Use JSON for arrays and objects.
Quick check
localStorage stores...
Summary
Well done. Next, a new section. JavaScript outside the browser, with Node.
Key takeaways- querySelector
- textContent
- preventDefault
Next up: Node and Files — JavaScript on your computer