1. Get DOM node
< div> Limited query
< div>
dojo.byId(param)param: can be a node ID name or a node
p>
2. Add DOM node
dojo.create(node,nodeObject,nodeRelation,nodeLocation)
node :Node name
nodeObject :Node attributes{innerHTML:”,className:”,style:{fontWeight:’bold’}}
nodeRelation: the parent or sibling of the node
nodeLocation: relative position to nodeRelation node,(first,before,after,last(default))
3. Insert DOM node
dojo.place(node,relationNode,location)
node: insert node
relationNode: reference node p>
location: relative position (first, before, after, last (default) )
4. Delete DOM node
dojo.destory()Delete the node and its children
dojo.empty() Delete the node
5. Batch Operation
Dojo query, The return value is array
dojo.query(“#id”) [index]According to ID < /span>
dojo.query(“.class”) [index]according to class
Restricted query
dojo. query(“#list #one”)Query the entire DOM tree
dojo.query(“#one”,dojo.byId(“list”)) Query in qualified conditions (Use qualified queries as much as possible to improve efficiency) p>
Other queries
< span style="white-space:pre"> The incoming parameters are: tag name and class namedojo.query(“a.one”)
6.NodeList
The result set returned by dojo.query() is NodeList p>
Common methods:
< strong>
1.forEach(function(node,index,nodelist){ }) Traverse
2.style, replaceClass, addClass, place, empty, etc., these methods are Return to nodeList, which can be used in series
dojo.query( ‘#red’).removeClass(‘red’).addClass(‘black’)
< /p>
3. span>connect connect to DOM events,