Textarea cols Property - Change the width and height of a text area using the cols and rows properties: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea

Description

Textarea cols Property - Change the width and height of a text area using the cols and rows properties:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<textarea id="myTextarea">
new value//from   w w  w  .  j a  va  2 s.  c o  m
</textarea>

<button type="button" onclick="myFunction()">Test</button>

<script>
function myFunction() {
    document.getElementById("myTextarea").style.height = "100px";
    document.getElementById("myTextarea").style.width = "500px";
}
</script>

</body>
</html>

Related Tutorials