HTML DOM cols ÊôÐÔ
¶¨ÒåºÍÓ÷¨
cols ÊôÐÔÉèÖûò·µ»ØÎı¾¿òµÄ×Ö·ûÁеĿí¶È¡£
Óï·¨
textareaObject.cols=number_of_columns
ʵÀý
ÏÂÃæµÄÀý×Ó¸ü¸ÄµÄÎı¾¿òµÄ¿í¶È£º
<html>
<head>
<script type="text/javascript">
function changeCols()
{
document.getElementById('txt1').cols="20";
}
</script>
</head>
<body>
<textarea id="txt1">
Hello world....This is a text area
</textarea>
<br />
<input type="button" onclick="changeCols()" value="Change width" />
</body>
</html>