JavaScript · Junior · Question 46 of 75

How does DOMContentLoaded differ from load?

Explanation

DOMContentLoaded is enough for working with the DOM (defer scripts run right before it). load waits for all resources, including images and iframes - you need it, for example, to measure image sizes.

Further reading

Problem with a question

JavaScript · Junior · question 46

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz