Qus : Which of the following properties is used to check whether an element has child nodes?
Qusनिम्नलिखित में से किस गुण का उपयोग यह जांचने के लिए किया जाता है कि किसी तत्व में चाइल्ड नोड हैं या नहीं?
A. hasChildNodes() B. childNodes
C. children D. hasChildren()
Solution
A. hasChildNodes()
Explanation
The hasChildNodes() method returns true if the element has child nodes (including text and comment nodes); otherwise, it returns false.