specified (W3C DOM Core property)
| Version | Depr. | Static | Read-only |
|---|---|---|---|
| DOM1 | No | No | Yes |
| IE5.5+ | FF1.5+ | SA1.3+ | OP9+ |
|---|---|---|---|
| Buggy | Buggy | Full | Full |
Example
if(node.attributes[0].specified === false)
{
//do something here
}
The example above uses the specified
property of a member of the attributes
collection as a condition, that passes only if the value is
false
Description
Whether an Attr node has an explicit value, ie. a value that the
author explicitly defined, rather than a default.
If the ownerElement property of this attribute is
null, as for example it would be for an attribute
that's been created but not yet added to an element, then specified is also true.
This property is readonly.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 1.5 | 2.0 | 3.0 | 1.3 | 2.0 | 3.0 | 9.0 | 9.5 |
| Buggy | Buggy | Buggy | Buggy | Buggy | Buggy | Full | Full | Full | Full | Full |
In
Firefox and Internet Explorer in
HTML the specified property of an
attribute that's been created or cloned, but not yet added to an element,
returns false (should be true).
In Internet Explorer 5.5 in HTML it's
not possible to create unattached attribute nodes at all (see createAttribute for details).
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.