dojo - dojo tutorial dom-construct in Dojo - coding dojo - dojo examples



  • This module can be used to :
    • Create a new element.
    • Delete an element from HTML document.
    • Place element in HTML document.

Iinitialisation

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
});

create()

  • 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"); 

destroy()

  • This function allows you to delete an element including it's children and content from the document.

Usage

domConstruct.destroy("someId"); 

place()

  • This function can be used to place nodes in a particular position in an HTML document

Usage

domConstruct.place("someNode", "refNode", "after"); 

empty()

  • This function can be used to delete content and all its children of a DOM element

Usage

domConstruct.empty("someId");

This dojo tutorial page provides you the following items dojo js tutorial , class dojo tutorial , dojo js , the dojo , dojo toolkit , learning dojo , dojo , what is a dojo , dojo programming , dojo javascript , dojo framework , define dojo , dojo require , dojo declare , dojo training , dojo xhr , dojo vs jquery , dojo examples , dojo application , dojo java , import dojo , dojo tree , dojo dom , call dojo , dojo ajax , dojo demo , dojo dojo , dojo json , dojo tutorial w3school , dojo widget , dojo full form , dojo jquery , dojo amd , dojo download , dojo library , dojo web , dojo tool , dojo build , coding dojo

Related Searches to dom-construct in Dojo