Textarea cols Property - Change the width of a text area using the style.width property: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea

Description

Textarea cols Property - Change the width of a text area using the style.width property:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<textarea id="myTextarea">
new value//  w  w  w .jav  a2 s  . c o  m
</textarea>

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

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

</body>
</html>

Related Tutorials