中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Textarea readOnly 屬性

Textarea 對象參考手冊 Textarea 對象

定義和用法

readOnly 屬性設置或返回 textarea 是否為只讀。

在只讀文本區(qū)域,不能改變內(nèi)容,但用戶可以"選項卡"設置,或突出顯示并復制它的內(nèi)容。

語法

設置 readOnly 屬性:

textareaObject.readOnly=true|false

返回 readOnly 屬性:

textareaObject.readOnly
描述
true 指定文本區(qū)是只讀
false 指定文本區(qū)域是可變。這是默認

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流瀏覽器都支持 readOnly 屬性


實例

實例

設置文本區(qū)域為只讀:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>小白教程(json.cn)</title>
<script>
function displayResult()
{
document.getElementById("myTextarea").readOnly=true;
}
</script>
</head>
<body>

<textarea id="myTextarea" cols="20">
在小白教程,你可以學多很多編程的基礎知識,包括 HTML, XML, SQL, ASP, 和 PHP 等各種前端內(nèi)容。
</textarea>
<br>

<button type="button" onclick="displayResult()">設置 textarea 為只讀</button>

</body>
</html>


Textarea 對象參考手冊 Textarea 對象其他擴展