R4RIN
Articles
Java 8
MCQS
JavaScript MCQ Quiz Hub
Javascript Multiple Choice Questions
Choose a topic to test your knowledge and improve your JavaScript skills
1. Why so JavaScript and Java have a similar name?
JavaScript is a stripped-down version of Java
JavaScript’s syntax is loosely based on Java’s
They both originated on the island of Java
None of the above
2. ______ JavaScript is also called client-side JavaScript.
Microsoft
Navigator
LiveWire
Native
3. What are variables used for in JavaScript Programs?
Storing numbers, dates, or other values
Varying randomly
Causing high-school algebra flashbacks
None of the above
4. ____ JavaScript statements embedded in an HTML page can respond to user events such as mouse clicks, form input, and page navigation.
Client-side
Server-side
Local
Native
5. What should appear at the very end of your JavaScript? The <script LANGUAGE=”JavaScript”>tag
The &lt;/script&gt;
The &lt;script&gt;
The END statement
None of above
6. Which of the following can’t be done with client-side JavaScript?
Validating a form
Sending a form’s contents by email
Storing the form’s contents to a database file on the server
None of the above
7. Which of the following are capabilities of functions in JavaScript?
Return a value
Accept parameters and Return a value
Accept parameters
None of the above
8. ______ tag is an extension to HTML that can enclose any number of JavaScript statements.
&lt;SCRIPT&gt;
&lt;BODY&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;
9. How does JavaScript store dates in a date object?
The number of milliseconds since January 1st, 1970
The number of days since January 1st, 1900
The number of seconds since Netscape’s public stock offering.
None of the above
10. Which of the following attribute can hold the JavaScript version?
LANGUAGE
SCRIPT
VERSION
None of the above
11. What is the correct JavaScript syntax to write “Hello World”?
System.out.println(“Hello World”)
println (“Hello World”)
document.write(“Hello World”)
response.write(“Hello World”)
12. Which of the following way can be used to indicate the LANGUAGE attribute?
&lt;LANGUAGE=”JavaScriptVersion”&gt;
&lt;SCRIPT LANGUAGE=”JavaScriptVersion”&gt;
&lt;SCRIPT LANGUAGE=”JavaScriptVersion”&gt; JavaScript statements…&lt;/SCRIPT&gt;
&lt;SCRIPT LANGUAGE=”JavaScriptVersion”!&gt; JavaScript statements…&lt;/SCRIPT&gt;
13. Inside which HTML element do we put the JavaScript?
&lt;js&gt;
&lt;scripting&gt;
&lt;script&gt;
&lt;javascript&gt;
14. Which types of image maps can be used with JavaScript?
Server-side image maps
Client-side image maps
Server-side image maps and Client-side image maps
None of the above
15. Which of the following navigator object properties is the same in both Netscape and IE?
navigator.appCodeName
navigator.appName
navigator.appVersion
None of the above
16. Which is the correct way to write a JavaScript array?
var txt = new Array(1:” Tim”,2:” Kim”,3:” Jim”)
var txt = new Array_1=(“Tim”)2=(“Kim”)3=(“Jim”)
var txt = new Array(“Tim”,” Kim”,” Jim”)
var txt = new Array=” Tim”,” Kim”,” Jim”
17. What does the <noscript> tag do?
Enclose text to be displayed by non-JavaScript browsers.
Prevents scripts on the page from executing.
Describes certain low-budget movies.
None of the above
18. JavaScript entities start with _______ and end with _________.
Semicolon, colon
Semicolon, Ampersand
Ampersand, colon
Ampersand, semicolon
19. Which of the following best describes JavaScript?
a low-level programming language.
a scripting language precompiled in the browser.
a compiled scripting language.
an object-oriented scripting language.
20. Choose the client-side JavaScript object?
Database
Cursor
Client
file upload
21. _____method evaluates a string of JavaScript code in the context of the specified object.
Eval
ParseInt
ParseFloat
Efloat
22. Which of the following event fires when the form element loses the focus: <button>, <input>, <label>, <select>, <textarea>?
onfocus
onblur
onclick
ondblclick
23. The syntax of Eval is ________________
[objectName.]eval(numeriC.
[objectName.]eval(string)
[EvalName.]eval(string)
[EvalName.]eval(numeriC.
24. JavaScript is interpreted by _________
Client
Server
Object
None of the above
25. Using _______ statement is how you test for a specific condition.
Select
If
Switch
For
Submit