3 4 2024 (Notes)
3 4 2024 (Notes)
3 4 2024 (Notes)
The HTML <form> element can contain one or more of the following form
elements:
Type Description
The <label> element also helps users who have difficulty clicking on
very small regions (such as radio buttons or checkboxes) - because when
the user clicks the text within the <label> element, it toggles the radio
button/checkbox.
The for attribute of the <label> tag should be equal to the id attribute of
the <input> element to bind them together.
Example
Example
<option value="fiat" selected>Fiat</option>
Visible Values:
Use the size attribute to specify the number of visible values:
Example
<label for="cars">Choose a car:</label>
<select id="cars" name="cars" size="3">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
Allow Multiple Selections:
Use the multiple attribute to allow the user to select more than one value:
Example
<label for="cars">Choose a car:</label>
<select id="cars" name="cars" size="4" multiple>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
4.The <textarea> Element
The <textarea> element defines a multi-line input field (a text area):
Example
Address : <textarea name="message" rows="10" cols="30">
The cat was playing in the garden.
</textarea>
The rows attribute specifies the visible number of lines in a text area.
The cols attribute specifies the visible width of a text area
Example
Creating Frames
To use frames on a page we use <frameset> tag instead of <body> tag. The
<frameset> tag defines, how to divide the window into frames.
Each frame is indicated by <frame> tag and it defines which HTML document
shall open into the frame.
<head>
<title>HTML Frames</title>
</head>
</html>
Dividing the frames in to columns
<!DOCTYPE html>
<html>
<head>
<title>HTML Frames</title>
</head>
</html>