Latest web development tutorials

HTML DOM isId property

Property Object Reference Attribute object

Examples

Check whether the ID attribute attribute element:

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

Output:

true

try it"

Definition and Usage

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

In addition to Internet Explorer and Opera browser, the other major browsers support isId property.


grammar

attribute .isId

technical details

return value: Boolean, true | false
DOM version Core Level 3


Property Object Reference Attribute object