assign a variable to elements innertext and then set value javascript code example Example: change innertext javascript element.innerText = "Hello World";