Textarea ElementNameTextarea Element---a multiline text input areaAvailabilityNavigator 2.0, Internet Explorer 3.0; enhanced in Navigator 3.0 Synopsis
form.name form.elements[i] Properties
Methods
Event Handlers
HTML SyntaxA Textarea element is created with standard HTML <TEXTAREA> and </TEXTAREA> tags, with the addition of optional attributes for event-handlers:
<FORM> ... <TEXTAREA [ NAME="name" ] a name that can later be used to refer to this element [ ROWS=integer ] how many lines tall the element is [ COLS=integer ] how many characters wide the element is [ WRAP=off|virtual|physical ] how word wrapping is handled [ onBlur="handler" ] the onblur() event handler [ onChange="handler" ] the onchange() event handler [ onFocus="handler" ] the onfocus() event handler > plain_text the initial text; specifies defaultValue </TEXTAREA> ... </FORM> DescriptionThe Textarea element represents a text input field in a form. The NAME attribute specifies a name for the element. This is mandatory if the form is to be submitted, and also provides a convenient way to refer to the Textarea element from JavaScript code. The COLS attribute specifies the width, in characters, of the element as it appears on the screen, and the ROWS attribute specifies the height, in lines of text, of the element. The WRAP attribute specifies how long lines should be handled: the value off specifies that they should be left as is; the value virtual specifies that they should be displayed with line breaks but transmitted without; and the value physical specifies that they should be displayed and transmitted with line breaks inserted. Besides these HTML attributes, value is the main property of interest for the Textarea element. You can read this property to obtain the user's input, or you can set it to display arbitrary (unformatted) text in the Textarea. The initial value of the value property (and the permanent value of the defaultValue property) is the text that appears between the <TEXTAREA> and </TEXTAREA> tags. UsageIf you need only a single line of input text, use the Text element. If the text to be input is sensitive information, such as a password, use the Password element. |
|