Q
What is the difference between the DOMContentLoaded and load events?
-
A
DOMContentLoaded waits for images
-
B
load fires first
-
C
DOMContentLoaded fires when the HTML is parsed; load waits for all resources, such as images and stylesheets
-
D
They are identical
Correct Answer:
C. DOMContentLoaded fires when the HTML is parsed; load waits for all resources, such as images and stylesheets
Explanation:
Code that only manipulates the DOM can start at DOMContentLoaded.