INPUT type=text Element | INPUT type=text Object

DHTML, HTML, & CSS

INPUT type=text Element | INPUT type=text Object


Creates a single-line text entry control.

HTML Syntax

<INPUT	
   ACCESSKEY = key
   ALIGN = LEFT | CENTER | RIGHT
   ALT = text
   CLASS = classname
   DISABLED
   ID = value
   LANG = language 
   LANGUAGE = JAVASCRIPT | JSCRIPT | VBSCRIPT  | VBS
   LOWSRC = url
   MAXLENGTH = n
   NAME = name
   READONLY
   SIZE = n
   STYLE = css1-properties
   TABINDEX =n
   TITLE =text
   TYPE = TEXT
   VALUE = value
   event  = script
>

Remarks

The SIZE attribute sets the number of visible characters in the text element. The MAXLENGTH attribute sets the maximum number of characters that can be entered.

The text element is an inline element and does not require a closing tag.

This element is available in HTML and script as of Microsoft® Internet Explorer 3.0.

Members

Styles

Example

This example uses the text element to create an empty text control that can contain 15 characters without requiring the user to scroll to read all of the text.

Sample Code

<INPUT TYPE=text VALUE="" NAME="textbox" SIZE=15>

This example uses script to detect the content of the text box and display it in a dialog box.

<SCRIPT>
function detectEntry()
{
    alert("Your name is " + textbox.value)
}
</SCRIPT>

The preceding HTML code and script examples implement the following text box. Click the What Is Your Name? button to call the detectEntry() function.

Enter your name:

See Also

INPUT, TEXTAREA


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.