Search
We can get access to the text inside an HTML element using its innerText property.
innerText
As you can see in the console, it logs the text Happiness. But, the text content later changes to Contentment. The updated text is displayed in the browser.