Form: Text Input

This syntax defines a one-line input field for text input:

<input type="text">
HTML file: Displayed by browser:
<form>
  First name:<br />
  <input type="text" name="firstname">
  <br /><br />
  Last name:<br />
  <input type="text" name="lastname" size="40">
</form>
First name:


Last name:

The form itself is not visible. Also note that the default width of a text field is 20 characters, which the attribute size="value" can change.

Back button Table of Contents Next button