Javascript examples for DOM HTML Element:Textarea
The type property returns which type of form element a text area is.
For a text area object it returns "textarea".
Type | Description |
---|---|
String | The type of form element the text area is |
The following code shows how to check which type of form element a text area element is:
<!DOCTYPE html> <html> <body> <textarea id="myTextarea" rows="4" cols="50"> new value//from ww w .jav a2 s. co m </textarea> <button type="button" onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myTextarea").type; document.getElementById("demo").innerHTML = x; } </script> </body> </html>