HTML DOM type 属性

定义和用法

type 属性返回文本域的表单元素类型。对于文本域,该属性总是返回 "text"。

语法

textObject.type

实例

下面的例子返回了文本域的表单元素类型:

<html>
<body>

<form>
<input type="text" id="text1" />
</form>

<script type="text/javascript">
x=document.getElementById("text1");
document.write("Form element type is: ");
document.write(x.type);
</script>

</body>
</html>
系统帮助 | 给我留言 | 收藏本站
Copyright © 2005-2008 www.cnn84.com All Rights Reserved Ver:2.0
CNN84网是公益性便民网站,是为了给大家的日常生活查询及提供最快捷的出行指南