in Education by
What is the code to start displaying the time when the document loads? (a) onload = displayTime; (b) window. = displayTime; (c) window.onload = displayTime; (d) window.onload = start; This question was posed to me in an interview for job. My doubt is from Embedding JavaScript in HTML topic in section Server-Side and Client-Side Scripting of JavaScript Select the correct answer from above options JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Correct answer is (c) window.onload = displayTime; The explanation: window.onload is used to access the screen while the page is loading. The above code starts displaying the time when the document loads.

Related questions

0 votes
    Which function is used to start the time logging? (a) startTimeLogging() (b) start() (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    Which handler is triggered when the content of the document in the window is stable and ready for ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    Which of this package is used for analyzing code during run-time? (a) java.applet (b) java.awt ( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What is the code for getting the current time? (a) now = new Date(); (b) var now = new ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    How to calculate the run time of a code? (a) Start time - End time (b) End time - Start ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    When does Exceptions in Java arises in code sequence? (a) Run Time (b) Compilation Time (c) Can ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    When does JavaScript code appear inline within an HTML file? (a) Between the script tag (b) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    Which is the root element in a HTML document? (a) HTML (b) HEAD (c) SCRIPT (d) BODY This ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    The word document mainly refers to ______________ (a) Dynamic Information (b) Static Information (c) Both ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    What are the properties supporting CSS styles for a document element? (a) style and font (b) style ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
...