<html>
<body>
<h1>The Element Object</h1>
<h2>The nodeType Property</h2>
<p id="myP">Click the button to get the node type of this element.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myP").nodeType;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>