X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM specified Property

Attributes Object Reference Attribute Object

Example

Find out if an attribute has been specified or not:

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

The result of x 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

Property
specified Yes Yes Yes Yes Yes


Syntax

attribute.specified

Technical Details

Return Value: A Boolean, returns true if the attribute is specified, otherwise false
DOM Version Core Level 1


Attributes Object Reference Attribute Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook