About Lesson
JavaScript hasAttribute
To check if an HTML element has any attributes, you can use the hasAttributes() method. This method returns true if the specified node has any attributes, otherwise false.
Syntax:
hasAttribute(name);
JavaScript hasChildNodes
To check if an HTML element has child nodes, you can use the hasChildNodes() method. This method returns true if the specified node has any child nodes, otherwise false.
Syntax:
hasChildNodes();
Exercise Files
No Attachment Found
Join the conversation