You are here: Reference > HTML > tags > input:text

input:text element

Browser support:
Creates a single-line text input control.
This control is one of the form controls.
The contents of the control can be submitted to a server if the following conditions are met:
  • A form element must contain the text control.
  • The action attribute of the container form must be set to the URL of the server.
  • The name attribute of the text control must be specified and non-empty.
When the container form is submitted, the name and the text content of the control are sent as a name/value pair.
If you need a multiline text input control, see the page for the textArea attribute.
If you want to see the HTML tags by categories, please visit this page.
This element cannot have a closing tag.
JavaScript page for this element: input:text.

Possible members:

Attributes
Events
Styles
Pseudos
accessKey
Sets an access key to an element.
align
Sets the object's position with respect to the surrounding text.
autoComplete
Sets whether the text field should give the user some suggestion during typing.
class
Sets the style class or classes that belong to the element.
contentEditable
3
Sets whether the contents of the object are editable.
dataFld
Specifies which field of a given data source should be bound to the specified object.
dataSrc
Sets the identifier of the data source that is bound to the element.
dir
Sets the text direction as related to the lang attribute.
DISABLED
Sets the state of an object for user interaction.
HIDEFOCUS
Specifies whether a dotted rectangle (focus rectangle) is drawn around an object while it has focus.
hSpace
Specifies the number of pixels to use as a margin at the left and right sides of the object.
id
Sets a unique identifier for the object.
lang
Specifies the language of the element.
language
Sets the scripting language for the current element. Use it only for the script element.
maxLength
Sets the maximum number of characters allowed in a text box.
name
Sets the name of a form control that affects the contents of the message submitted to the server.
placeholder
Sets the initial value of the text field.
READONLY
Sets whether the contents of the element are changeable.
size
Specifies the width of a control, in characters.
spellcheck
Sets whether the automatic spellchecker is enabled.
style
Sets an inline style associated with an element.
tabIndex
Specifies the tabbing order for keyboard navigation using the TAB key.
title
Specifies a tooltip for an element.
type
Sets the type of the input element.
unSelectable
Sets whether the selection process can start in an element's content.
value
Specifies the initial value for a control element.
vCard_name
Specifies the vCard type to use for the Autocomplete box.
vSpace
Specifies the number of pixels to use as a margin at the top and bottom sides of an object.

Example HTML code 1:

This example illustrates the use of the text input element:
<form method="post" action="#URL#">
    Username: <input type="text" name="userName" />
    <br />
    Email: <input type="text" name="email" />
    <br /><br />
    <input type="submit" value="Register" />
</form>
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content