innerHTML innerText innerTextNode code example
Example 1: HTML DOM innerText
var x = document.getElementById("myBtn").innerText;
Example 2: javascript innertext vs innerhtml
innerHTML shows everything inside of the element.
innerText shows only the text inside of the element.