There are many times we use JavaScript to interact with DOM text nodes and change the text. There are several ways to grab an element from the DOM…
html...
JavaScript...
or we can grab the element like this…
We then have several ways to change the text. One of the ways you will run across is with the innerText property…
Note that innerText is not an “official” part of the JavaScript standard specs, but is supported by all modern browsers.
If you wish to use the spec way to change the text…
Using innerText property
Using textContent