The type
property returns the type of a textarea.
type |
Yes | Yes | Yes | Yes | Yes |
var v = textareaObject.type
Type | Description |
---|---|
String | The type of the textarea |
The following code shows how to get the type of a textarea element.
<!DOCTYPE html>
<html>
<body>
<!-- w w w . j av a2s . c o m-->
<textarea id="myTextarea" rows="4" cols="50">
this is a test
</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>
The code above is rendered as follows: