简单教程
提交运行
代码编辑器:
<script> function displayResult(){ var x=document.getElementById("button1").type; alert(x); } </script> <form> <input type="button" onclick="displayResult()" value="显示按钮类型" id="button1"> </form>
运行结果: