Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM isId Property

HTML DOM isId Property

Attribute Object Reference Attribute object

Example

Checks whether the attribute is the element's ID attribute:

document.getElementById("demo").attributes[0].isId;

Output result:

true

Try it »


Definition and Usage

If the attribute is of ID type (for example, it contains the identifier of the element it belongs to), the isId property returns true; otherwise it returns false.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All other major browsers except Internet Explorer and Opera support the isId property.


Syntax

attribute

.isId

Technical Details

Return Value: Boolean, true|false
DOM version Core Level 3

Attribute Object Reference Attribute object