Search w3schools.com:

SHARE THIS PAGE

DOM Attr isId Property

Attr Object Reference Attr Object

Example

Find out if an attribute is the element's ID attribute or not:

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

The result will be:

true

Try it yourself »

Definition and Usage

The isId property returns true if the attribute is of type ID, otherwise it returns false.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The isId property is supported in all major browsers, except Internet Explorer and Opera.


Syntax

attribute.isId

Technical Details

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


Attr Object Reference Attr Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]