DEV Community

ASHWINTH
ASHWINTH

Posted on

Html Form

What is html forms?
An HTML forms are elements used to collect input from users on a webpage . Forms are created using the

element, which acts as a container for various input fields such as text boxes, radio buttons, checkboxes, dropdown menus, and submit buttons.

. Text Input

Used to collect short text such as names or usernames.


<input type="text" name="username">
  1. Password Input

Masks the entered text for security.

<input type="password" name="password">
  1. Email Input

Ensures the entered value follows a valid email format.

  1. Number Input cccepts only numeric values.

<input type="number" name="age">
  1. Radio Buttons

Allows users to select only one option from a group.Allows users to select multiple options.


<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female
  1. Checkboxes

HTML
CSS

  1. Dropdown List
<select name="country">
    <option>India</option>
    <option>USA</option>
    <option>Canada</option>
</select>
  1. Textarea

Used for longer text input, such as comments or feedback.

  1. Submit Button

Sends the form data to the server.

Top comments (0)