Q. The nodes that represent HTML elements are the

  • (A) Subclass nodes
  • (B) HTML nodes
  • (C) Window nodes
  • (D) Element nodes
πŸ’¬ Discuss
βœ… Correct Answer: (D) Element nodes
Explanation: The nodes that represent HTML elements are Element nodes.

Q. Which of the following is/are of Text nodes?

  • (A) Text
  • (B) Comment
  • (C) Both Text and Comment
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both Text and Comment
Explanation: Both Text and Comment are basically strings of text, and these nodes are much like the Text nodes that represent the displaying text of a document.

Q. Which is one of way to query a document for an element or elements?

  • (A) With a specified id attribute
  • (B) Matching the specified CSS selector
  • (C) With the specified tag name
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned
Explanation: he DOM defines a number of ways to select elements; you can query a document for an element or elements:

Q. 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()
πŸ’¬ Discuss
βœ… Correct Answer: (B) getElementsByName()
Explanation: To select HTML elements based on the value of their name attributes, you can use the getElementsByName() method of the Document object:

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

  • (A) documentElement
  • (B) elementdocument
  • (C) rootdocument
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) documentElement
Explanation: The documentElement property of the Document class refers to the root element of the document. This is always an HTML element.

Q. The return type of getElementsByClassName() is

  • (A) DOM
  • (B) Document
  • (C) Node
  • (D) NodeList
πŸ’¬ Discuss
βœ… Correct Answer: (D) NodeList
Explanation: Like getElementsByTagName(), getElementsByClassName() can be invoked on both HTML documents and HTML elements, and it returns a live NodeList containing all matching descendants of the document or element.

Q. Each tab in the single web browser window is called as

  • (A) Browser Information
  • (B) Browsing context
  • (C) Both Browser Information & Browsing context
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) Browsing context
Explanation: A single web browser window on your desktop may contain several tabs. Each tab is an independent browsing context.

Q. Nested documents in the HTML can be done using

  • (A) frame
  • (B) nest
  • (C) iframe
  • (D) into
πŸ’¬ Discuss
βœ… Correct Answer: (C) iframe
Explanation: HTML documents may contain nested documents using an iframe element. An iframe creates a nested browsing context represented by a Window object of its own.

Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (A) They are all browsing contexts
Explanation: Client-side JavaScript makes very little distinction between windows, tabs, iframes, and frames: they are all browsing contexts, and to JavaScript, they are all Window objects.

Q. What is the distinction made by 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
πŸ’¬ Discuss
βœ… Correct Answer: (D) They are all Window objects
Explanation: Client-side JavaScript makes very little distinction between windows, tabs, iframes, and frames: they are all browsing contexts, and to JavaScript, they are all Window objects.