how to change the text of a span in javascript code example Example: javacsript update text in span document.getElementById("myspan").textContent="newtext";