<!DOCTYPE html>
<html>
<body>

<p>Click the input button to find out which type of form element it is.</p>

<input type="button" onclick="myFunction()" id="myBtn" value="Try it">

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myBtn").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>