HTML part 3

Table of Contents

Label
Button
select
Option
Textarea

Label:

It is used to tell the user what to enter in the input box.
It is best to connect label with input using for and id.
When the user click on the label, input gets foc…


This content originally appeared on DEV Community and was authored by Nanthini Ammu

Table of Contents

  • Label
  • Button
  • select
  • Option
  • Textarea

Label:

  • It is used to tell the user what to enter in the input box.
  • It is best to connect label with input using for and id.
  • When the user click on the label, input gets focused.

Example :

<form>
    <label for="email">Email:</label>
    <input type="email" id="email"><br><br>

    <label for="password">Password:</label>
    <input type="password" id="password">
</form>

Button:

  • It is used to perform an action when clicked like submitting form and resetting form.

Types of button:

  • button
  • submit
  • reset

*Example : *

<button>Click Me</button>
<button type="button">Normal</button>
<button type="submit">Submit</button>
<button type="reset">Reset</button>

select:

  • It is used to create drop down list.
  • It allows users to choose one or more options.

Example :

<label for="city">Choose City:</label>
<select id="city">
    <option>Chennai</option>
    <option>Delhi</option>
    <option>Mumbai</option>
</select>


<select name="city">
    <option value="chn">Chennai</option>
    <option value="del">Delhi</option>
</select>

Here the value is what gets sent to server.

For Multiple Selection :

<select multiple>
    <option>HTML</option>
    <option>CSS</option>
    <option>JavaScript</option>
</select>

Option:

It is used to define items inside a dropdown.
It can have value attribute.
We can mention default selected option.
We can disable a option.

Example :

<select>
    <option value="">Select Course</option>
    <option value="html">HTML</option>
    <option value="css" selected>CSS</option>
    <option value="js" disabled>JavaScript</option>
</select>

Textarea:

  • It is used to take multline input from user.

Example :

<form>
    <label for="feedback">Feedback:</label><br>

    <textarea id="feedback" name="feedback" rows="5" cols="30"
        placeholder="Enter your feedback here"></textarea><br><br>

    <button type="submit">Submit</button>
</form>


This content originally appeared on DEV Community and was authored by Nanthini Ammu


Print Share Comment Cite Upload Translate Updates
APA

Nanthini Ammu | Sciencx (2026-03-26T06:17:44+00:00) HTML part 3. Retrieved from https://www.scien.cx/2026/03/26/html-part-3/

MLA
" » HTML part 3." Nanthini Ammu | Sciencx - Thursday March 26, 2026, https://www.scien.cx/2026/03/26/html-part-3/
HARVARD
Nanthini Ammu | Sciencx Thursday March 26, 2026 » HTML part 3., viewed ,<https://www.scien.cx/2026/03/26/html-part-3/>
VANCOUVER
Nanthini Ammu | Sciencx - » HTML part 3. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2026/03/26/html-part-3/
CHICAGO
" » HTML part 3." Nanthini Ammu | Sciencx - Accessed . https://www.scien.cx/2026/03/26/html-part-3/
IEEE
" » HTML part 3." Nanthini Ammu | Sciencx [Online]. Available: https://www.scien.cx/2026/03/26/html-part-3/. [Accessed: ]
rf:citation
» HTML part 3 | Nanthini Ammu | Sciencx | https://www.scien.cx/2026/03/26/html-part-3/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.