var top = dojo.byId("top"); for (var i = 0; i < top.childNodes.length; i++) { var currentNode = top.childNodes[i]; if (currentNode.nodeType == 1 && currentNode.className == "status") { top.removeChild(currentNode); } } var status = document.createElement("span"); status.className = "status"; status.innerHTML = message; top.appendChild(status); dojo.fadeOut({ node: status, duration: 2000 }).play();