πŸ§ͺ JavaScript MCQ Quiz Hub

JavaScript MCQ Questions And Answers

Choose a topic to test your knowledge and improve your JavaScript skills

ο»ΏWhy so JavaScript and Java have similar name?





βœ… Correct Answer: 2

When a user views a page containing a JavaScript program, which machine actually executes the script?





βœ… Correct Answer: 1

_____ JavaScript is also called client-side JavaScript.





βœ… Correct Answer: 2

_______ JavaScript is also called server-side JavaScript.





βœ… Correct Answer: 3

What are variables used for in JavaScript Programs?





βœ… Correct Answer: 1

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





βœ… Correct Answer: 1

What should appear at the very end of your JavaScript? The <script LANGUAGE="JavaScript">tag





βœ… Correct Answer: 1

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





βœ… Correct Answer: 3

Which of the following are capabilities of functions in JavaScript?





βœ… Correct Answer: 3

Which of the following is not a valid JavaScript variable name?





βœ… Correct Answer: 1

_____ tag is an extension to HTML that can enclose any number of JavaScript statements.





βœ… Correct Answer: 1

How does JavaScript store dates in a date object?





βœ… Correct Answer: 1

Which of the following attribute can hold the JavaScript version?





βœ… Correct Answer: 1

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





βœ… Correct Answer: 3

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





βœ… Correct Answer: 3

Inside which HTML element do we put the JavaScript?





βœ… Correct Answer: 3

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





βœ… Correct Answer: 3

Which types of image maps can be used with JavaScript?





βœ… Correct Answer: 2

Which of the following navigator object properties is the same in both Netscape and IE?





βœ… Correct Answer: 1

Which is the correct way to write a JavaScript array?





βœ… Correct Answer: 3

What does the <noscript> tag do?





βœ… Correct Answer: 1

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





βœ… Correct Answer: 2

JavaScript entities start with _______ and end with _________.





βœ… Correct Answer: 4

Which of the following best describes JavaScript?





βœ… Correct Answer: 4

Choose the server-side JavaScript object?





βœ… Correct Answer: 3

Choose the client-side JavaScript object?





βœ… Correct Answer: 4

Which of the following is not considered a JavaScript operator?





βœ… Correct Answer: 2

_____method evaluates a string of JavaScript code in the context of the specified object.





βœ… Correct Answer: 1

Which of the following event fires when the form element loses the focus: <button>, <input>, <label>, <select>, <textarea>?





βœ… Correct Answer: 2

The syntax of Eval is _______________





βœ… Correct Answer: 2

JavaScript is interpreted by ________





βœ… Correct Answer: 1

Using _______ statement is how you test for a specific condition.





βœ… Correct Answer: 2

Which of the following is the structure of an if statement?





βœ… Correct Answer: 3

How to create a Date object in JavaScript?





βœ… Correct Answer: 1

The _______ method of an Array object adds and/or removes elements from an array.





βœ… Correct Answer: 4

To set up the window to capture all Click events, we use which of the following statement?





βœ… Correct Answer: 1

Which tag(s) can handle mouse events in Netscape?





βœ… Correct Answer: 2

___________ is the tainted property of a window object.





βœ… Correct Answer: 3

To enable data tainting, the end user sets the _________ environment variable.





βœ… Correct Answer: 3

In JavaScript, _________ is an object of the target language data type that encloses an object of the source language.





βœ… Correct Answer: 1

When a JavaScript object is sent to Java, the runtime engine creates a Java wrapper of type ___________





βœ… Correct Answer: 2

_____ class provides an interface for invoking JavaScript methods and examining JavaScript properties.





βœ… Correct Answer: 2

_______ is a wrapped Java array, accessed from within JavaScript code.





βœ… Correct Answer: 1

A ________ object is a reference to one of the classes in a Java package, such as netscape.javascript .





βœ… Correct Answer: 2

The JavaScript exception is available to the Java code as an instance of __________





βœ… Correct Answer: 2

To automatically open the console when a JavaScript error occurs which of the following is added to prefs.js?





βœ… Correct Answer: 4

To open a dialog box each time an error occurs, which of the following is added to prefs.js?





βœ… Correct Answer: 1

The syntax of a blur method in a button object is ______________





βœ… Correct Answer: 1

The syntax of capture events method for document object is ______________





βœ… Correct Answer: 3

The syntax of close method for document object is _____________





βœ… Correct Answer: 4