1.

What is the property to access the first child of a node?(a) timestamp.Child1(b) timestamp.Child(1)(c) timestamp.Child(0)(d) timestamp.firstChildThe question was asked during an online interview.I'd like to ask this question from JavaScript in Web Browsers in chapter Server-Side and Client-Side Scripting of JavaScript

Answer»

Correct answer is (d) timestamp.firstChild

The EXPLANATION is: The first child of a node can be accessed USING the firstChild property. firstChild RETURNS the first child node as an element node, a TEXT node or a comment node (depending on which ONE’s first).



Discussion

No Comment Found

Related InterviewSolutions