JavaScript Language | 10 Minute‐Test 27


Instruction

  • Total number of questions : 10.
  • Time alloted : 10 minutes.
  • Each question carry 1 mark.
  • No Negative marks
  • DO NOT refresh the page.
  • All the best :-).

1.

Which is the function used to retrieve a value?

A.
get()
B.
retrieve()
C.
getItem()
D.
retrieveItem()

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

To retrieve a value, pass the name to getItem().

2.

What is the default value of the type attribute?

A.
text/css
B.
text/javascript
C.
text
D.
xml

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

The default value of the type attribute is “text/javascript”. You can specify this type explicitly if you want, but it is never necessary.

3.

Which is the property that represents the content displayed in the window?

A.
document
B.
content
C.
window
D.
frame

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

One of the most important properties of the Window object is document: it refers to a Document object that represents the content displayed in the window.

4.

How to pick a document element based on the value of its id attribute?

A.
getElementsbyId()
B.
getElementbyId()
C.
Both a and b
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

The Document object has important methods such as getElementById(), which returns a single document element (representing an open/close pair of HTML tags and all of the content between them) based on the value of its id attribute.

5.

Which of the following is a web application API framework?

A.
Dojo
B.
YUI
C.
GWT
D.
All of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

GWT, the Google Web Toolkit , is a completely different kind of client-side framework. It defines a web application API in Java and provides a compiler to translate your Java programs into compatible clientside JavaScript.

6.

To which object does the location property belong?

A.
Window
B.
Position
C.
Element
D.
Location

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

The location property of the Window object refers to a Location object, which represents the current URL of the document displayed in the window, and which also defines methods for making the window load a new document.

7.

What is the purpose of the assign() method?

A.
Only loading
B.
Loading of window and display
C.
Displays already present window
D.
Unloading of window

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

The assign() method of the Location object makes the window load and display the document at the URL you specify.

8.

Which of the below properties can be used for browser sniffing?

A.
platform
B.
appVersion
C.
Both a and b
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The platform and appVersion can be used for browser sniffing.

9.

When will the fourth argument to open() useful?

A.
When the second argument names a retired window
B.
When the first argument names an existing window
C.
When the second argument names an existing window
D.
When the first argument names a retired window

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The fourth argument to open() is useful only when the second argument names an existing window. This fourth argument is a boolean value that indicates whether the URL specified as the first argument should replace the current entry in the window’s browsing history (true) or create a new entry in the window’s browsing history (false). Omitting this argument is the same as passing false.

10.

Which of the following property refers to the root element of the document?

A.
documentElement
B.
Elementdocument
C.
rootdocument
D.
None of the mentioned
Submit your test now to view the Results and Statistics with answer explanation.