This module can be used to :
Create a new element.
Delete an element from HTML document.
Place element in HTML document.
To be able to use the dom-construct
module we need to load it as fallow :
require(["dojo/dom-construct"], function(domConstruct){
// Write code here
});
This function can be used to create an element and add it in a specific position. It also allows you to set attributes and content.
Usage
var node = domConstruct.create("div", { style: { color: "red" }}, "someId", "first");
This function allows you to delete an element including it's children and content from the document.
Usage
domConstruct.destroy("someId");
This function can be used to place nodes in a particular position in an HTML document
Usage
domConstruct.place("someNode", "refNode", "after");
This function can be used to delete content and all its children of a DOM element
Usage
domConstruct.empty("someId");