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>