tag is an extension to HTML that can enclose any number of JavaScript statement | 14 JavaScript Advance MCQ's Question And Answers

14 JavaScript MCQ's Question And Answers

tag is an extension to HTML that can enclose any number of JavaScript statement

1. Which of the following best describes JavaScript?

a) a low-level programming language.

b) a scripting language pre-compiled in the browser.

c) a compiled scripting language.

d) an object-oriented scripting language.


Answer: d) an object-oriented scripting language.


2. Scripting languages are

a) high-level programming language.

b) assembly-level programming language.

c) machine-level programming language.


Answer: a) high-level programming language

Learn More About:

JavaScript-Syntax


3. --- tag is an extension to HTML that can enclose any number of JavaScript statement.

a) <SCRIPT>

b) <BODY>

c) <HEAD>

d) <TITLE>


Answer: a) <SCRIPT>


4. --- JavaScript is also called client-side JavaScript.

a) Microsoft

b) navigator

c) Live wire

d) native


Answer: c) Live wire

Learn More About JavaScript


5. Why JavaScript and Java have similar names?

a) JavaScript is a stripped-down version of Java.

b) JavaScript syntax is loosely based on Java

c) They both originated on the island of Java.

d) None of the above.


Answer: b) JavaScript syntax is loosely based on Java


6. What should appear at the very end of your JavaScript?

The<script LANGUAGE="JavaScript">tag


a) The </script>

b) the <script>

c) The END statement

d) None Of The Above.


Answer: a) The </script>


7. Which of the following can't be done with client-side JavaScript?

a) Validating a form 

b) Sending a forms content by email

c) Storing the form contents to a database file on the server

d) None of the above.


Answer: c) Storing the form contents to a database file on the server


8. --- JavaScript statement embedded in an HTML page can respond to user events such as mouse clicks, form input, and page navigation.

a) Client-side.

b) Server-side

c) Local 

d) Native


Answer: a) Client-side.


9. Which of the following are capabilities of functions in JavaScript?

a) Return a value

b) Accept parameters and return a value

c) Accept parameters

d) None of the above


Answer: c) Accept parameters


10. 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")


Answer: c) document.write("Hello World")


11. 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"


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

Learn More About JavaScripyt Array.


12. How does JavaScript store dates in data 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.


Answer: a) the number of milliseconds since January 1st, 1970


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

a) LANGUAGE

b) SCRIPT

c) VERSION

d) None of the above


Answer: a) LANGUAGE


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

a) <LANGUAGE="JavaScriptVersion">

b) <SCRIPT LANGUAGE="JavaScriptVersion">

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

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


Answer: c) <SCRIPT LANGUAGE="JavaScriptVersion">JavaScript statements...</SCRIPT>


learn More: The longest path from node x to the leaf node?

Post a Comment

0 Comments