Skip to content

Latest commit

 

History

History
73 lines (61 loc) · 1.85 KB

level-5.md

File metadata and controls

73 lines (61 loc) · 1.85 KB

Key HTML Form Controls 🚀

Label

  • 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>

Class & Id

  • Attributes used to group and style elements (class) and uniquely identify an element within the HTML document (ID).
<div id="id1" class="group1">
</div>

<div id="id2"> class="group1">
</div>

Checkbox

  • 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>

Textarea

  • 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>

Select

  • 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>

iframe Tag

  • Embeds an external web page within the current HTML document website inside website
<iframe src="link"> Link </option>

Video Tag

  • 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.