Q. Which of the following is the child(s) of the node type EntityReference?

  • (A) Element
  • (B) Text
  • (C) Both Element and Text
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both Element and Text
Explanation: The children of the node tyoe EntityReference are Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference.

Q. Which node type represents the root-node of the DOM tree?

  • (A) Document
  • (B) DocumentFragment
  • (C) DocumentType
  • (D) Entity
πŸ’¬ Discuss
βœ… Correct Answer: (A) Document
Explanation: The node type Document represents the root-node of the DOM tree, the entire document.

Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (A) To hold a portion of a document
Explanation: The DocumentFragment node type represents a “lightweight” Document object, which can hold a portion of a document.

Q. How many nodetype – named constants are available?

  • (A) 13
  • (B) 11
  • (C) 12
  • (D) 10
πŸ’¬ Discuss
βœ… Correct Answer: (C) 12
Explanation: There are totally 12 nodetype – named constants available.

Q. Which of the following Node types have a node value equal to null?

  • (A) Document
  • (B) DocumentFragment
  • (C) DocumentType
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned
Explanation: All the three node types namely, Document, DocumentFragment, DocumentType have a node value equal to null.

Q. How many node object properties are there?

  • (A) 12
  • (B) 14
  • (C) 16
  • (D) 17
πŸ’¬ Discuss
βœ… Correct Answer: (C) 16
Explanation: There are totally 16 node object properties.

Q. How many node types are there in total?

  • (A) 11
  • (B) 12
  • (C) 13
  • (D) 14
πŸ’¬ Discuss
βœ… Correct Answer: (B) 12
Explanation: There are total of 12 node types.

Q. What is the purpose of the Node object property ownerDocument?

  • (A) Returns the root element
  • (B) Returns the last element
  • (C) Returns the parent node
  • (D) Returns the immediate node
πŸ’¬ Discuss
βœ… Correct Answer: (A) Returns the root element
Explanation: The node object property ownerDocument returns the root element (document object) for a node.

Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (B) localName
Explanation: The Node object property localName Returns the local part of the name of a node

Q. What is the property textContent?

  • (A) Sets the textual content of a node
  • (B) Returns the textual content of a node
  • (C) Sets & Returns the textual content of a node
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) Sets & Returns the textual content of a node
Explanation: The property textContent sets or returns the textual content of a node and its descendants.