dojo.removeAttr¶
Status: | Final |
---|---|
Version: | 1.0 |
Available: | since 1.2 |
Contents
Removes an attribute.
Introduction¶
dojo.removeAttr() removes an attribute. It is modeled after DOM’s removeAttribute, but unlike the latter it normalizes standard attribute names to smooth over differences between browsers, or to provide convenient aliases, e.g., className is aliased to class, and so on. The same algorithm is used by dojo.attr.
Usage¶
1 | dojo.removeAttr(node, attr);
|
- node
- id or reference of the DOM node to get/set style for
- attr
- the attribute property name.
Examples¶
Removing an attribute¶
The following example will remove disabled from the input node.
<script type="text/javascript"> function remAttr(){ dojo.removeAttr("model", "disabled"); } </script>
<p><input id="model" name="model" disabled="disabled" value="some text"> — our model node</p> <p><button onclick="remAttr();">Removed "disabled"</button></p>