Not really sure what the question is?
There are two ways to use
One is to set the text of the element. Assuming you have an
h1 element with
id='h1Elem, then you can write the following to change its value.
document.getElementById('h1Elem').innerText = 'New Text Goes Here'
You can also use it to get the current value of an element’s text. Assume you have the following HTML:
<h1 id="myH1">Hello World!</h1>
I can get the text value of the h1 element by:
const h1Text = document.getElementById('myH1').innerText;
console.log(h1Text); // displays Hello World!