You are here: Reference > JavaScript > client-side > HTML DOM > properties > type (textarea)

type property (textarea)

Browser support:
Returns the type of a textarea element.
This is a left-over property, from the time when the textarea was an input element.

Syntax:

object.type;
You can find the related objects in the Supported by objects section below.
This property is read/write.

Possible values:

String that represents the element type.
Only the following value is possible:
textarea
Element is a TextArea object.
Default: textarea.

Example HTML code 1:

This example illustrates the use of the type property:
<head>
    <script type="text/javascript">
        function GetAreaType (elem) {
            alert ("The type of element: " + elem.type);
        }
    </script>
</head>
<body>
    <textarea onclick="GetAreaType (this)">Click this text!</textarea>
</body>
Did you find this example helpful? yes no

Supported by objects:

External links:

User Contributed Comments

Post Content

Post Content