日期:2014-05-16 浏览次数:20465 次
<html>
<body>
<script type="text/javascript">
function getType(){
var but=document.getElementById("but").type;
var text=document.getElementById("text").type;
alert(but+" "+text);//提示“button text”
}
</script>
<input id="but" type="button" onclick="getType()">
<input id="text" type="text">
</body>
</html>