Form Labels <form>
- A form is a region that contains form elements.
- Form elements are elements that allow users to enter information into a form.
Input tags <input>
The input type of the input label is determined by its type attribute. The common input types are as follows:
<type= "text" name= "InputName"/>
- Radio buttons radio button
Note : You can only select one of these.
<form> <inputtype= "Radio"name= "Sex"value= "Male" />male<BR/> <inputtype= "Radio"name= "Sex"value= "female" />female</form>
Used when the user wants to select one or more options from several options.
<form> <inputtype= "checkbox"name= "Apple" />Apple<BR/> <inputtype= "checkbox"name= "Banana" />Banana<BR/> <inputtype= "checkbox"name= "Orange" />Orange</form>
< form > < type= "button" value= "click me"></ Form>
- Password Password and submit button submit
<formAction= "target.html"Method= "Get">User:<inputtype= "text"name= "User"> <BR/>Password:<inputtype= "Password"name= "Password"> <BR/> <inputtype= "Submit"value= "Submit" /></form>
field labels <fieldset> and domain title tags <legend>
Field labels <fieldset> can package related elements within a form and generate a field for a set of related forms. Browsers can display groups of elements in a special way, such as special boundaries, 3D effects, or even create a sub-form to handle these elements.
Field labels <fieldset> no required properties. The <legend> tag defines the title for the field label.
<form> <fieldset> <legend>Health information</legend>Height:<inputtype= "text" /> <BR/>Weight:<inputtype= "text" /> </fieldset></form>
<label> tags
The <label> tag defines a tag for the INPUT element. It will not render any special effects, but when you place the mouse over the label element, clicking on the text will trigger the control.
The For property of the <label> tag should be the same as the id attribute of the related element.
<form> <label for= "Male">Man</label> <inputtype= "Radio"name= "Sex"ID= "Male" /> <BR/> <label for= "female">Woman</label> <inputtype= "Radio"name= "Sex"ID= "female" /></form>
Drop-down list <select>
<Select> <Optgrouplabel= "Swedish Cars"> <optionvalue= "Volvo">Volvo</option> <optionvalue= "Saab">Saab</option> </Optgroup> <Optgrouplabel= "German Cars"> <optionvalue= "Mercedes">Mercedes</option> <optionvalue= "Audi" selected= "true">Audi</option> </Optgroup></Select>
HTML Notes (v) forms <form> and their related elements