Easy Tutorial
❮ Prop Frame Marginheight Event Img Onload ❯

HTML DOM hasAttributes() Method

Element Object

Example

Check if the body element has any attributes.

Output result:


Definition and Usage

The hasAttributes() method returns true if the node has any attributes, otherwise it returns false.


Browser Support

All major browsers support the hasAttributes method.

Note: Internet Explorer 8 and earlier versions do not support this method.


Syntax

Parameters

None

Return Value

Type Description
Boolean Returns true if the node has attributes, otherwise returns false

Technical Details

| DOM Version | Core Level 2 Node Object | | --- | --- |


Element Object

❮ Prop Frame Marginheight Event Img Onload ❯