Document Object Model And Event Handling - Study Mode

[#101] The nodes that represent HTML elements are the
Correct Answer

(D) Element nodes

Explanation

Solution: The nodes that represent HTML elements are Element nodes.

[#102] Which of the following is/are of Text nodes?
Correct Answer

(C) Both Text and Comment

Explanation

Solution: 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.

[#103] Which of the following property refers to the root element of the document?
Correct Answer

(A) documentElement

Explanation

Solution: The documentElement property of the Document class refers to the root element of the document. This is always an HTML element.

[#104] The return type of getElementsByClassName() is
Correct Answer

(D) NodeList

Explanation

Solution: 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.

[#105] Cookies were originally designed for
Correct Answer

(B) Server-side programming

Explanation

Solution: Cookies were originally designed for server-side programming, and at the lowest level, they are implemented as an extension to the HTTP protocol.