Techoceanhub logo

Input types (text, checkbox, radio buttons, etc.) in HTML

There are various types of input fields that can be used in web forms to gather user information. Here are some commonly used input types along with examples:

  1. Text Input: Allows users to enter a single line of text. Example: <input type="text" name="username" placeholder="Enter your username">
  2. Password Input: Conceals the entered text (usually used for passwords). Example: <input type="password" name="password" placeholder="Enter your password">
  3. Email Input: Validates that the entered text is in the format of an email address. Example: <input type="email" name="email" placeholder="Enter your email address">
  4. Number Input: Accepts numerical values. Example: <input type="number" name="quantity" min="1" max="100" placeholder="Enter a number between 1 and 100">
  5. Checkbox: Allows users to select multiple options from a list. Example:
<label for="option1">
  <input type="checkbox" id="option1" name="options" value="option1"> Option 1
</label>
<label for="option2">
  <input type="checkbox" id="option2" name="options" value="option2"> Option 2
</label>

6. Radio Buttons: Allows users to select a single option from a list. Example:

<label for="option1">
  <input type="radio" id="option1" name="options" value="option1"> Option 1
</label>
<label for="option2">
  <input type="radio" id="option2" name="options" value="option2"> Option 2
</label>

7. Dropdown Select: Presents a list of options in a dropdown menu. Example:

<select name="country">
  <option value="usa">USA</option>
  <option value="canada">Canada</option>
  <option value="uk">UK</option>
</select>

8. File Upload: Allows users to select and upload files from their device. Example: <input type="file" name="file">

9. Date Input: Enables users to select a date from a calendar picker. Example: <input type="date" name="date">

These are just a few examples of input types available in HTML forms. Each input type serves a specific purpose and helps in collecting different types of user input.

Share:

Categories

Archives

Related Posts

Array Destructuring

Array Destructuring Array destructuring is a powerful syntax introduced in ES6 that allows you to unpack elements from an array

Read More »

Explore our Affiliated partner links

hostgator website plan

Hostgator

Best Website hosting plans & Best for 24/7 support.

hostinger webhosting plan

Hostinger

Reasonable website hosting packages for small business & 24/7 Email support

Elementor pro

Design Worpdress website quickly using Elementor Builder and AI

buy elementor website templates

Buy Elementor Website Template

Buy ready made Elementor Website Template from us & Get Free Elementor pro licence for 1 year .