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

Javascript examples for DOM HTML Element:Textarea

Description

Textarea defaultValue Property - Get the default value 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 ava  2 s  .  c  o  m
New York</textarea>

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

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

</body>
</html>

Related Tutorials