dojo/dom-attr¶
Project owner: | Eugene Lazutkin |
---|---|
since: | V1.7 |
Contents
This module defines the core Dojo DOM attributes API. The standard return variable for this module is
domAttr
.
Features¶
AMD Features¶
-
Returns true if the requested attribute is specified on the given element, and false otherwise.
-
Gets an attribute on an HTML element.
-
Sets an attribute on an HTML element.
-
Removes an attribute from an HTML element.
-
Returns an effective value of a property or an attribute.
Legacy features are set in dojo/_base/html.
Examples¶
require(["dojo/dom-attr"], function(domAttr){
if domAttr.has("nodeId", "foo"){
console.log("nodeId has attribute foo = " + domAttr.get("nodeId", "foo"));
}else{
console.log("nodeId doesn't have attribute foo");
}
});
See also¶
- dojo/dom - Core DOM API
- dojo/dom-class - Dojo DOM Class API
- dojo/dom-prop - DOM Property API
- dojo/dom-style - DOM Style API
- dojo/_base/html - Legacy API aliases
API Reference: dojo.dom-attr