|
|
|
|
|
hasAttribute
hasAttribute is a boolean value indicating whether the current element has the specified attribute or not.
Syntax
[ true | false ] = element.hasAttribute(attName)Parameters
attName is a string representing the name of the attribute
Example
// check that the attirbute exists // before you set a value d = document.getElementById("div1"); if d.hasAttribute("align") { d.setAttribute("align", "center"); }
Notes
Specification
core
| mozilla.org | mailto:oeschger | bug 93108 |
|
|
|
|
|