Multiple choice technology web technology

What is the syntax which will display the image on the screen for 5 seconds?

  1. setTimeout('run()','50000');

  2. setTimer('run()','5');

  3. setTimeout('run()','500');

  4. setTimeout('run()','5000');

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The setTimeout function schedules a function to execute after a specified delay in milliseconds. Option D correctly sets a 5-second delay (5000 milliseconds). Option A would wait 50 seconds, option C would wait only 0.5 seconds, and option B references a non-existent setTimer function. To convert seconds to milliseconds, multiply by 1000.