Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Element Object</h1>
<h2>The nodeValue Property</h2>
<button>Try it</button>
<p>The node value of the first button element is:</p>
<p id="demo"></p>
<script>
const element = document.getElementsByTagName("BUTTON")[0];
let value = element.childNodes[0].nodeValue;  
document.getElementById("demo").innerHTML = value;
</script>
</body>
</html>