HTML DOM readOnly 屬性
定義和用法
readOnly 屬性可設(shè)置或返回密碼域是否為只讀。
語法
passwordObject.readOnly=true|false
實(shí)例
下面的例子把密碼域設(shè)置為只讀:
<html>
<head>
<script type="text/javascript">
function makeReadOnly()
{
document.getElementById("password1").readOnly=true
}
</script>
</head>
<body>
<form>
<input type="password" id="password1" value="thgrt456" />
<input type="button" onclick="makeReadOnly()"
value="Make read-only" />
</form>
</body>
</html>