change inner text of an element js code example Example: javacsript update text in span document.getElementById("myspan").textContent="newtext";