MCQ Bank
Why we used setAttribute() method?
- A) To change an attribute value
- B) To change a text value
- C) To change a node value
- D) To change an element value
Nodes in the node list are accessed with index numbers starting from ___________.
- A) 2
- B) -1
- C) 1
- D) 0
Which of the following methods can be used to create a new comment node?
- A) createnewComment()
- B) createComment()
- C) none of the given options
- D) newcreateComment()
The ______ method can be used to remove the specified node.
- A) removeChild()
- B) reChild()
- C) dropChild()
- D) deleteChild()
Traversing means _________ through or traveling across the node tree.
- A) adding
- B) looping
- C) printing
- D) spinning
By using the _________, we can loop through a node list.
- A) node type
- B) length property
- C) title
- D) None of the given options
Which parameter in replaceData() method tells the parser how many characters to replace?
- A) length
- B) offset
- C) None of the given
- D) string
Which property of XML document represents the root node?
- A) nodeType
- B) nodeName
- C) nodeValue
- D) documentElement
Which of the following specifies the type of node?
- A) nodeValue
- B) nodeName
- C) nodeType
- D) None of the given
when you want to extract the value of each element. This is called __________________.
- A) "Traversing the node tree"
- B) "Traversing first and last tree"
- C) "Traversing the last tree"
- D) "Traversing the first tree"
When a node is removed, ___________________________.
- A) its child nodes navigated to other nodes.
- B) its child nodes are not removed.
- C) all its child nodes are also removed.
- D) None of the above.
The term CDATA is used about ________ data that should not be parsed by the XML parser.
- A) video
- B) Null
- C) text
- D) audio
When using properties or methods like childNodes or getElementsByTagName(), a node list __________ is returned.
- A) Object
- B) Function
- C) Class
- D) Array
Whenever we access the nodes in the node tree via the relationship between these nodes, is called_________.
- A) childNodes
- B) none of the given options
- C) parentNode
- D) navigating nodes
What will be the nodeValue for attribute nodes?
- A) Node value
- B) Element value
- C) Text value
- D) Attribute value
if (x[i].nodeType == 2) then node type will be:
- A) Element
- B) Node
- C) None of the given options
- D) Attribute
XML often contains new line, or _______ space characters, between nodes.
- A) green
- B) black
- C) white
- D) red
Which of the following methods return attribute node?
- A) None of the given options
- B) getElementsByTagName()
- C) getAttribute()
- D) getAttributeNode()
The _____________ method creates a new element node.
- A) getElement()
- B) createElement()
- C) newElement()
- D) makeElement()
Which of the following is used to get the value of an attribute?
- A) getAttribute()
- B) nodeValue
- C) getAttributeNode
- D) getElementsByTagName()