while(node.firstChild){ node.removeChild(node.firstChild); } node.appendChild(dojo.doc.createTextNode(text));