代码编辑器:
x
1
<script>
2
function displayResult(){
3
var x=document.getElementById("submit1").type;
4
alert(x);
5
}
6
</script>
7
<form>
8
Email: <input type="text" id="email">
9
<input type="submit" id="submit1">
10
</form>
11
<button type="button" onclick="displayResult()">显示 input 类型</button>
12