HTML DOM size 属性

定义和用法

size 属性可设置或返回密码域的大小(以字符数计)。

语法

passwordObject.size=number_of_chars

实例

下面的例子更改了密码域的大小:

<html>
<head>
<script type="text/javascript">
function changeSize()
  {
  document.getElementById("password1").size=40
  }
</script>
</head>
<body>

<form>
<input type="password" id="password1" />
<input type="button" id="button1" onclick="changeSize()"
value="Change size of the password field" />
</form>

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