屬性:
Common -- 壹般屬性
cols -- 多行輸入域的列數
rows -- 多行輸入域的行數
alt -- 代表表單的提示文字,當鼠標停留時
accesskey -- 表單的快捷鍵訪問方式
disabled -- 輸入域無法獲得焦點,無法選擇,以灰色顯示,在表單中不起任何作用
readonly -- 輸入域可以選擇,但是無法修改
tabindex -- 輸入域,使用"tab"鍵的遍歷順序
引用網址:/xhtml/tag_textarea/
沒見value屬性,但實際還可用,賦值時用innerText、innerHTML、value都可以,如下:
<html>
<head></head>
<script type="text/javascript">
function changeTextArea(){
document.getElementById("myTextArea").innerText=document.getElementById("myTextArea").innerText+"\ninnerText is ok!";
document.getElementById("myTextArea").innerHTML=document.getElementById("myTextArea").innerText+"\ninnerHTML is ok!";
document.getElementById("myTextArea").value=document.getElementById("myTextArea").innerText+"\nvalue is ok!";
}
</script>
<body>
<textarea name= "myTextArea" cols= "80 " rows= "10 ">原始值</textarea>
<input type="button" value="按鈕" onclick="changeTextArea()"/>
</body>
</html>