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

Javascript examples for DOM HTML Element:Textarea

Description

Textarea rows Property - Change the height and width 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//www  . j ava2 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