Search w3schools.com:

SHARE THIS PAGE

DOM Attr specified Property

Attr Object Reference Attr Object

Example

Find out if an attribute has been specified or not:

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

The result will be:

true

Try it yourself »

Definition and Usage

The specified property returns true if the attribute is specified.

Returns true also if the attribute has been created but not been attached to an element yet.

Otherwise it returns false.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The specified property is supported in all major browsers.


Syntax

attribute.specified

Technical Details

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


Attr Object Reference Attr Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]