HTML DOM isIdProperty
Example
Check whether the attribute is an ID attribute of the element:
document.getElementById("demo").attributes[0].isId;
Output:
true
Try it yourself »
Definition and Usage
If the attribute is of ID type (for example, it contains the identifier of the element to which it belongs), the isId property returns true; otherwise, it returns false.
Browser Support
![]()
![]()
![]()
![]()
![]()
Except for Internet Explorer and Opera, all other major browsers support the isId property.
Syntax
attribute.isId
Technical Details
| Return value: | Boolean, true|false |
|---|---|
| DOM Version | Core Level 3 |
Other Extensions
Attr Object