1 2
var result = document.getElementById("result"); result.firstChild.nodeValue = result.attributes.getNamedItem("text").value;