Top 80+ Solved JavaScript MCQ Questions Answer

From 46 to 60 of 67

Q. ______ tag is an extension to HTML that can enclose any number of JavaScriptstatements.

a. <SCRIPT>

b. <BODY>

c. <HEAD>

d. <TITLE>

  • a. <SCRIPT>

Q. How does JavaScript store dates in a date object?

a. The number of milliseconds since January 1st, 1970

b. The number of days since January 1st, 1900

c. The number of seconds since Netscape's public stock offering.

d. None of the above

  • a. The number of milliseconds since January 1st, 1970

Q. Which of the following attribute can hold the JavaScript version?

a. LANGUAGE

b. SCRIPT

c. VERSION

d. None of the above

  • a. LANGUAGE

Q. What is the correct JavaScript syntax to write "Hello World"?

a. System.out.println("Hello World")

b. println ("Hello World")

c. document.write("Hello World")

d. response.write("Hello World")

  • c. document.write("Hello World")

Q. Which of the following way can be used to indicate the LANGUAGE attribute?

a. <LANGUAGE="JavaScriptVersion">

b. <SCRIPT LANGUAGE="JavaScriptVersion">

c. C. <SCRIPT LANGUAGE="JavaScriptVersion"> JavaScript statements…</SCRIPT>

d. D. <SCRIPT LANGUAGE="JavaScriptVersion"!> JavaScript statements…</SCRIPT>

  • c. C. <SCRIPT LANGUAGE="JavaScriptVersion"> JavaScript statements…</SCRIPT>

Q. Inside which HTML element do we put the JavaScript?

a. <js>

b. <scripting>

c. <script>

d. <javascript>

  • c. <script>

Q. What is the correct syntax for referring to an external script called " abc.js"?

a. <script href=" abc.js">

b. <script name=" abc.js">

c. <script src=" abjs">

d. None of the above

  • c. <script src=" abc.js">

Q. Which types of image maps can be used with JavaScript?

a. Server-side image maps

b. Client-side image maps

c. Server-side image maps and Client-side image maps

d. None of the above

  • b. Client-side image maps

Q. Which of the following navigator object properties is the same in both Netscapeand IE?

a. navigator.appCodeName

b. navigator.appName

c. navigator.appVersion

d. None of the above

  • a. navigator.appCodeName

Q. Which is the correct way to write a JavaScript array?

a. var txt = new Array(1:"tim",2:"kim",3:"jim")

b. var txt = new Array:1=("tim")2=("kim")3=("jim")

c. var txt = new Array("tim","kim","jim")

d. var txt = new Array="tim","kim","jim"

  • c. var txt = new Array("tim","kim","jim")

Q. What does the <noscript> tag do?

a. Enclose text to be displayed by non-JavaScript browsers.

b. Prevents scripts on the page from executing.

c. Describes certain low-budget movies.

d. None of the above

  • a. Enclose text to be displayed by non-JavaScript browsers.

Q. If para1 is the DOM object for a paragraph, what is the correct syntax to changethe text within the paragraph?

a. "New Text"?

b. para1.value="New Text";

c. para1.firstChild.nodeValue= "New Text";

d. para1.nodeValue="New Text";

  • b. para1.value="New Text";

Q. JavaScript entities start with _______ and end with _________.

a. Semicolon, colon

b. Semicolon, Ampersand

c. Ampersand, colon

d. Ampersand, semicolon

  • d. Ampersand, semicolon

Q. Which of the following best describes JavaScript?

a. a low-level programming language.

b. a scripting language precompiled in the browser.

c. a compiled scripting language.

d. an object-oriented scripting language.

  • d. an object-oriented scripting language.

Q. Choose the server-side JavaScript object?

a. FileUpLoad

b. Function

c. File

d. Date

  • c. File
Subscribe Now

Get All Updates & News