The INPUT element defines an input field. When you specify "text" for the type attribute of this element, a text box is created.
<input type="text" name="name1">
<input type="text" name="name2" size="30" maxlength="30" value="Example">
Attribute |
Value |
Explanation |
type=" " |
text |
the type of input field (the default is "text") |
name=" " |
field name |
a unique name for the field |
size=" " |
number of characters |
the input field width |
maxlength=" " |
number of characters |
the maximum number |
value=" " |
initial value |
the text displayed in the field |
- type="text"
- Creates a text box on the form.
- name=""
- The field name is used to identify the form field.
- size=""
- The input field width is specified by the number of characters.
- maxlength=""
- Specifies the maximum number of characters allowed in the input field.
- value=""
- Specifies the initial text displayed in the input field.
Example