Input Tag
The <input> tag is used within <form> tags to create form fields.
<form>
Your name: <input type="text" name="name"><br>
<input type="submit" value="Send">
</form>
Attributes
-
autocomplete - should the input allow autocompletion
- checked - For checkbox and radio input types. Select this input by default when the page loads.
- disabled - Disable the form field.
- form - ID of the form the input belongs to.
- max - Max allowed value for date or number.
- maxlength - Max allowed characters
- min - Min allowed value for date or number.
- name - The name of the input.
- placeholder - Default text to display in the input. This will disappear when a user clicks into the input.
- readonly - Users cannot edit the content of the textarea. For read only.
- required - This field is required before the form submits.
-
type - What type of input is this.
- button
- checkbox
- color
- date
- datetime
- email
- file
- hidden
- image
- month
- number
- password
- radio
- range
- reset
- search
- submit
- tel
- text
- time
- url
- week
- value - The value of the input.