Textarea rows Property - Get the height of a text area, in characters: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea

Description

Textarea rows Property - Get the height of a text area, in characters:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<textarea id="myTextarea" rows="4" cols="50">
new value//w w w  .  j av a2 s.  c o  m
</textarea>

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

<script>
function myFunction() {
    var v = document.getElementById("myTextarea").rows;
    console.log(v);
}
</script>

</body>
</html>

Related Tutorials