When does code inside $(document).ready() run?
-
A
When the user first clicks
-
B
When every image has loaded
-
C
When the DOM is fully built
Correct answer
-
D
Before the HTML is parsed
Correct answer
C. When the DOM is fully built
15 views
Explanation
$(document).ready() fires as soon as the DOM is ready to manipulate, before images finish loading. $(window).on('load') waits for all resources.
Reference
Asked in: Frontend Developer Tests, Technical Interviews
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ