Course Content
Javascript Full Course
0/87
JavaScript Course
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
No Attachment Found
Join the conversation

Introducing Official ApeStaking Protocol for ApeCoin.

New Blur NFT Marketplace Courting Professional.