Explore topic-wise MCQs in Javascript.

This section includes 183 Mcqs, each offering curated multiple-choice questions to sharpen your Javascript knowledge and support exam preparation. Choose a topic below to get started.

101.

_ Which is the property that is triggered in response to JavaScript errors?$?

A. onexception
B. onmessage
C. onerror
D. none of the mentioned
Answer» D. none of the mentioned
102.

_ What value does the keyCode property holds when a Shift key is pressed for adding punctuation character?$?

A. Special characters
B. Alphabets
C. Alphanumeric
D. Digits
Answer» E.
103.

_ Which property holds a DataTransfer object that contains information about the data being transferred and the formats in whichh it is available?$?

A. dataTransfer
B. transferData
C. dataExchange
D. exchangeData
Answer» B. transferData
104.

_ The events that is emulated by the jQuery library are$?

A. focusarea and focusover
B. focusall and focusnone
C. focusdown and focusup
D. focusin and focusout
Answer» C. focusdown and focusup
105.

_ Which property reports rotation around three different mouse wheel axes?$?

A. ctrlKey
B. alterX
C. alterY
D. deltaX
Answer» E.
106.

__The client-side JavaScript’s asynchronous programming model contains__

A. Timers and error handlers
B. User interface events
C. State change events
D. API-specific events
Answer» B. User interface events
107.

__Which of the following uses scripted HTTP?__

A. XML
B. HTML
C. Ajax
D. All of the mentioned
Answer» D. All of the mentioned
108.

_What is the purpose of the method item()?$?

A. Returns node after the specified index
B. Returns node before the specified index
C. Returns node at specified index
D. None of the mentioned
Answer» D. None of the mentioned
109.

_How to test if two nodes are equal?$?

A. isEqualNode()
B. equal()
C. ==
D. none of the mentioned
Answer» B. equal()
110.

_Which of the following explains Cookies nature?$?

A. Non Volatile
B. Volatile
C. Intransient
D. Transient
Answer» E.
111.

_How many nodetype – named constants are available?$?

A. 13
B. 11
C. 12
D. 10
Answer» D. 10
112.

_Which of the following is a boolean cookie attribute?$?

A. bool
B. secure
C. lookup
D. domain
Answer» C. lookup
113.

_What will happen if we call setTimeout() with a time of 0 ms?$?

A. Placed in stack
B. Placed in queue
C. Will run continuously
D. None of the mentioned
Answer» C. Will run continuously
114.

_Which among the following is not a property of the Location object?$?

A. protocol
B. host
C. hostee
D. hostname
Answer» D. hostname
115.

_Why is the replace() method better than the assign() method?$?

A. Reliable
B. Highly managable
C. More efficient
D. Handles unconditional loading
Answer» E.
116.

_The node directly above a node is called$?

A. sibling
B. child
C. parent
D. ancestors
Answer» D. ancestors
117.

_The length property belongs to which of the following objects?$?

A. Window
B. Element
C. History
D. Document
Answer» D. Document
118.

_Which is the preferred testing nowadays for scripting?$?

A. Software testing
B. Feature testing
C. Blackbox testing
D. Whitebox testing
Answer» C. Blackbox testing
119.

_What is the distinction made by the Client-side JavaScript between windows, tabs, iframes, and frames ?$?

A. They are all browsing contexts
B. They are all browsing informations
C. They are all Window contexts
D. They are all Window objects
Answer» B. They are all browsing informations
120.

_Which is the property of a Window object that holids the name of the frame?$?

A. name
B. title
C. description
D. none of the mentioned
Answer» B. title
121.

_Which of the following is a factory function?$?

A. $()
B. jQuery()
C. Queryanalysis()
D. None of the mentioned
Answer» C. Queryanalysis()
122.

_Which of the following is an equivalent replacement of $(document).ready(f)?$?

A. jQuery(f)
B. $(f)
C. #(f)
D. None of the mentioned
Answer» C. #(f)
123.

_Which of the following are the features of an HTTP request?$?

A. URL being requested
B. Optional request body
C. Optional set of request headers
D. All of the mentioned
Answer» E.
124.

_Which of the following are objective database and not a relational database?$?

A. Web SQL Database
B. FileSystem API
C. IndexedDB
D. All of the mentioned
Answer» D. All of the mentioned
125.

_What is the alternate way to search in an IndexedDB API?$?

A. Key
B. Address
C. Indexes
D. All of the mentioned
Answer» D. All of the mentioned
126.

_Which is the Microsoft’s own proprietary client-side storage?$?

A. IE User Data
B. Offline Web Applications
C. Cookies
D. All of the mentioned
Answer» B. Offline Web Applications
127.

_What is the lifetime of the data stored through localStorage?$?

A. Permanant
B. Temporary
C. Both Permanant and Temporary at times
D. Cannot store
Answer» B. Temporary
128.

_In general, event handler is nothing but$?

A. function
B. interface
C. event
D. handler
Answer» B. interface
129.

_The events that are directly tied to a specific input device are$?

A. Device-independent input events
B. Device-dependent input events
C. User interface events
D. State change events
Answer» C. User interface events
130.

_Which of the following is the ultiate element selection method?$?

A. querySelectorAll()
B. querySelector()
C. queryAll()
D. query()
Answer» B. querySelector()
131.

_Which of the following is the default positioning elements with CSS?$?

A. relative
B. static
C. absolute
D. none of the mentioned
Answer» C. absolute
132.

_Which of the following can be used to select HTML elements based on the value of their name attributes?$?

A. getElementByName()
B. getElementsByName()
C. getElementsName()
D. getElementName()
Answer» C. getElementsName()
133.

_Which is the handler method used to invoke when uncaught JavaScript exceptions occur?$?

A. Onhalt
B. Onerror
C. Both onhalt and onerror
D. None of the mentioned
Answer» C. Both onhalt and onerror
134.

Which of the following Node object property returns the local part of the name of a node?$?

A. lastName
B. localName
C. firstName
D. none of the mentioned
Answer» C. firstName
135.

Which method is used to add a binding?$?

A. binding()
B. add_bind()
C. bind()
D. None of the mentioned
Answer» D. None of the mentioned
136.

Which of the following keys are set to true when the keyboard modifier keys are held down?$?

A. altKey
B. ctrlKey
C. metaKey
D. all of the mentioned
Answer» E.
137.

Which is the opposite to the load event in JavaScript?$?

A. dontload
B. postload
C. preload
D. unload
Answer» E.
138.

Which property is used to specify the key type when pressed?$?

A. keyCode
B. keyType
C. keyName
D. keyProperty
Answer» B. keyType
139.

Which of the following are the drag and drop events?$?

A. drop
B. dragstart
C. both drop and dragstart
D. none of the mentioned
Answer» D. none of the mentioned
140.

The element that can also register handlers for load and error events is$?

A. html
B. img
C. body
D. form
Answer» C. body
141.

Which object is passed as the argument to handlers for keydown, keyup, and keypress events?$?

A. KeyboardEvent
B. Key Event
C. Mouse Event
D. Alphabet Event
Answer» B. Key Event
142.

The video and the audio belong to the$?

A. Timers and error handlers
B. API-Specific events
C. State change events
D. User interface events
Answer» C. State change events
143.

Which method is an alternative of the property location of a window object?$?

A. submit()
B. locate()
C. load()
D. none of the mentioned
Answer» B. locate()
144.

What does the nodeName of the nodeType Document return??

A. doctype name
B. target
C. #comment
D. #document
Answer» E.
145.

What is the purpose of the method getUserData(key)??

A. Returns the associated object
B. Gets the user data
C. Returns the user data
D. None of the mentioned
Answer» B. Gets the user data
146.

The Cookie manipulation is done using which property??

A. cookie
B. cookies
C. manipulate
D. none of the mentioned
Answer» B. cookies
147.

What is the purpose of the DocumentFragment node type??

A. To hold a portion of a document
B. To split the document into fragments
C. To hold the entire document
D. None of the mentioned
Answer» B. To split the document into fragments
148.

How can you set a Cookie visibility scope to localStorage??

A. /
B. %
C. *
D. All of the mentioned
Answer» B. %
149.

Which method receives the return value of setTimeout() to cancel future invocations??

A. clearTimeout()
B. clearInterval()
C. clearSchedule()
D. none of the mentioned
Answer» B. clearInterval()
150.

What does the location property represent??

A. Current DOM object
B. Current URL
C. Both DOM object and URL
D. None of the mentioned
Answer» B. Current URL