JavaScript statement in span tag with the ID code example Example: javacsript update text in span document.getElementById("myspan").textContent="newtext";