Fixed grammatical issues and updated the text (#21329)

This commit is contained in:
EmeraldEntities
2018-11-09 22:08:41 -05:00
committed by Kristofer Koishigawa
parent 0e263c6a9c
commit efdb543d76

View File

@ -3,7 +3,9 @@ title: Input
--- ---
## Input ## Input
The HTML `<input>` tag is used to create an element which allows a user to input data. Typically this would be within a `<form>` element, although it's not required.
The HTML `<input>` tag is typically used within a `<form>` element to declare an input element.
It allows the user to enter data, and can vary in many ways.
### Example ### Example
```html ```html
@ -30,13 +32,21 @@ The HTML `<input>` tag is used to create an element which allows a user to input
</html> </html>
``` ```
In the above example, there is a form with two text fields which ask the user to enter their first and last names according to the labels specified. `<input type="submit">` is another type of input which is used to submit the form's data to the URL defined in the form's `action` attribute. In the above example, there are two input fields which ask the user to enter their first and last names according to the labels specified.
### Types Submit (`<input type="submit">`) is another type of input which is used to take the data entered by the user into the form and send it to some other location specified in the code.
There are many types of `<input>` tags which can be specified with the input's `type` attribute. A few common types are:
- **Text** - Creates a simple text box ### Input Types
- **Password** - Creates a text field but masks the characters typed into the input The HTML `<input>` tag uses the attribute `type` to specify what kind of input element to display. Some of these include:
- **Checkbox** - Creates a checkbox field that allows the user to select multiple options * `type = "text"` - This is the default type, and generates a one-line text field.
- **Radio** - Creates a field that allows a user to select only one option * `type = "password"`- This will generate a password field, and is used for (you guessed it!) passwords.
- **Submit** - Displays a button that submits the form when clicked * `type = "hidden"` - This will generate a hidden input field.
- **Hidden** - This is a special type that doesn't render on the page. It's typically used to pass additional data along with a form. * `type = "text"` - Creates a simple text box.
* `type = "password"` - Creates a text field but masks the characters typed into the input.
* `type = "checkbox"` - Creates a checkbox field that allows the user to select multiple options.
* `type = "radio"` - Creates a field that allows a user to select only one option.
* `type = "submit"` - Displays a button that submits the form when clicked.
* `type = "hidden"` - This is a special type that doesn't render on the page. It's typically used to pass additional data along with a form.
#### More Information:
[MDN - Input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input)