HTML DOM select() 方法

定义和用法

select() 方法用于选取密码域中的文本。

语法

passwordObject.select()

实例

下面的例子可选取密码域中的文本:

<html>
<head>
<script type="text/javascript">
function selText()
  {
  document.getElementById('password1').select()
  }
</script>
</head>
<body>

<form>
<input type="password" id="password1" value="thgrt456" />
<input type="button" onclick="selText()" value="Select text" />
</form>

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