simple html dom plaintext innertext outertext code example Example: HTML DOM innerText var x = document.getElementById("myBtn").innerText;