dojo/dom-construct¶
Project owner: | Eugene Lazutkin |
---|---|
since: | V1.7 |
Contents
This module defines the core dojo DOM construction API. The convention for the return variable for this module is
domConstruct
.
Features¶
AMD Features¶
-
Instantiates an HTML fragment returning the corresponding DOM.
-
Places a DOM node relative to an other.
-
Creates a DOM node with optional values and placement.
-
Empty the contents of a DOM node.
-
Destroy a DOM node.
Legacy features are set in dojo/_base/html.
Examples¶
require(["dojo/dom", "dojo/dom-construct"], function(dom, domConstruct){
// create a div node
var node = domConstruct.create("div");
// get a reference to another node
var refNode = dom.byId("refNode");
// place the constructed node at the referenced node
domConstruct.place(node, refNode);
});
See also¶
- dojo/dom - Core DOM API
- dojo/_base/html - Legacy API aliases
API Reference: dojo.dom-construct