Textarea value Property - Get the contents of a text area: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Textarea

Description

Textarea value Property - Get the contents of a text area:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Address:<br>
<textarea id="myTextarea">
Main Street//from   w  w  w.  j  av  a 2  s . com
New York</textarea>

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

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

</body>
</html>

Related Tutorials