HTML DOM readOnly ÊôÐÔ
¶¨ÒåºÍÓ÷¨
readOnly ÊôÐÔÉèÖûò·µ»Ø textarea ÊÇ·ñΪֻ¶Á¡£
Óï·¨
textareaObject.readOnly=true|false
ʵÀý
±¾Àý°Ñ textarea ÉèÖÃΪֻ¶Á£º
<html>
<head>
<script type="text/javascript">
function setReadOnly()
{
document.getElementById('txt1').readOnly=true;
}
</script>
</head>
<body>
<textarea id="txt1">
Hello world....This is a text area
</textarea>
<br />
<input type="button" onclick="setReadOnly()"
value="Make read-only" />
</body>
</html>