英 [taɪp]   美 [taɪp]  

n.类型;铅字;(印刷或打印的)文字;于…类型的

vt.& vi.打字

vt.[医学]测定(血型);按类型把…归类;成为…的典型;[印刷]浇铸(铅字等)

第三人称单数: types 复数: types 现在分词: typing 过去式: typed 过去分词: typed

javascript type属性 语法

作用:设置或返回按钮的类型。

语法:buttonObject.type=value

返回:submit    button 是提交按钮(是 IE 之外的所有浏览器的默认值)    button    button 是可点击的按钮(IE 的默认值)    reset    button 是重置按钮(清除表单数据)    

注释:请始终为按钮规定 type 属性。IE 浏览器的默认类型是 "button",而在其他浏览器中(以及在 W3C 规范中)是 "submit"。

javascript type属性 示例

<!DOCTYPE html>
<html>
<head>
<script>
function alertType()
{
alert(document.getElementById("myButton").type)
}
</script>
</head>
<body>

<button id="myButton" type="button" onclick="alertType()">点击这里</button>

</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

热门推荐