HTML forms are used to select different kinds of user input. A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, textarea fields, radio buttons, checkboxes, etc.) in a form. |
|
<form>
tag.
The most used form tag is the <input>
tag.
The type of input is specified with the type
attribute.
The most commonly used input types are explained below.
HTML Script | Web Display |
---|---|
<form> First name: <input type="text" name="firstname" /> Last name: <input type="text" name="lastname" /> </form> |
HTML Script | Web Display |
---|---|
<form> <input type="radio" name="sex" value="male" /> Male <input type="radio" name="sex" value="female" /> Female </form> |