Textarea Object cols Property
Textarea Object
Definition and Usage
The cols property sets or returns the width of a text
area.
Syntax
|
textareaObject.cols=number_of_columns
|
Example
The following example changes the width of a text area:
<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>
|
Textarea Object
|