access just inner text element in html by js code example Example: HTML DOM innerText var x = document.getElementById("myBtn").innerText;