1. Home
  2. Computer Science MCQs
  3. Jquery
  4. When does code inside $(document).ready() run?

Added 2 Nov 2026

When does code inside $(document).ready() run?

  1. When the user first clicks
  2. When every image has loaded
  3. When the DOM is fully built Correct answer
  4. Before the HTML is parsed

Correct answer

C. When the DOM is fully built

15 views

MCQSEXAM

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

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Jquery MCQs

Practise all Jquery MCQs

Similar MCQs