- Associates a visible text label with an input element for accessibility and user experience.
<label for="id1">
<input type="radio" value="class X" name="class" id="id1">
</label>
<label for="id2">
<input type="radio" value="class X" name="class" id="id2">
</label>
- Attributes used to
group
and style elements(class)
and uniquelyidentify
an element within the HTML document(ID)
.
<div id="id1" class="group1">
</div>
<div id="id2"> class="group1">
</div>
- Creates a checkable input field for selecting multiple options
<label for="id1">
<input type="checkbox" value="class X" name="class" id="id1">
</label>
<label for="id2">
<input type="checkbox" value="class X" name="class" id="id2">
</label>
- Allows users to input multi-line text, commonly used for comments or longer forms of input
<textarea name="feedback" id="feedback" placeholder="Please add Feedback">
</textarea>
- Creates a dropdown list of options for users to choose from.
<select name="city" id="city">
<option value="Delhi"> Delhi </option>
<option value="Mumbai"> Delhi </option>
<option value="Banglore"> Delhi </option>
</select>
- Embeds an external web page within the current HTML document website inside website
<iframe src="link"> Link </option>
- Embeds a video file within the HTML document
<video src="myVid.mp4"> My Video </video>
Attributes of Video Tag
controls
: Displays built-in media controls (play/pause, volume, etc.).height
: Sets the height of the video player.width
: Sets the width of the video player.loop
: Makes the video play repeatedly.autoplay
: Starts the video playing automatically.