Course Content
HTML Forms
HTML forms are an essential part of web development and provide a way for users to input and submit data to a server. Forms allow users to enter data such as text, numbers, checkboxes, radio buttons, and more. When a user submits a form, the data is typically sent to a server for further processing.
0/6
HTML Graphics
HTML provides various ways to incorporate graphics into web pages.
0/2
HTML Media
HTML provides built-in support for embedding and displaying various types of media content on web pages.
0/5
HTML APIs
HTML APIs, also known as browser APIs or web APIs, are a set of interfaces and methods provided by web browsers to interact with and manipulate web content, access device features, and perform various tasks. These APIs are implemented in JavaScript and are accessible to web developers when creating web applications. Here are some commonly used HTML APIs:
0/5
HTML Examples
Creating a Simple Web Page, Adding Links and Images and more
0/4
HTML5 for Free | HTML5 – Unleashing the Potential of Web Development
About Lesson

HTML provides a variety of form elements that allow users to input and select different types of data. Here are some commonly used form elements with examples:

  1. Text Input:
    The <input> element with type="text" creates a single-line text input field.
<input type="text" name="username" placeholder="Enter your username">

This creates a text input field where users can enter their username.

  1. Password Input:
    The <input> element with type="password" creates a password input field, where the entered text is masked for security.
<input type="password" name="password" placeholder="Enter your password">

This creates a password input field where users can enter their password.

  1. Checkbox:
    The <input> element with type="checkbox" allows users to select multiple options from a list.
<input type="checkbox" name="fruits" value="apple">
<label for="fruits">Apple</label>

<input type="checkbox" name="fruits" value="orange">
<label for="fruits">Orange</label>

This creates two checkboxes where users can select either or both options (apple and orange).

  1. Radio Button:
    The <input> element with type="radio" allows users to select a single option from a list.
<input type="radio" name="gender" value="male">
<label for="gender">Male</label>

<input type="radio" name="gender" value="female">
<label for="gender">Female</label>

This creates two radio buttons where users can select either the male or female option.

  1. Select Dropdown:
    The <select> element creates a dropdown menu for users to select an option from a list.
<select name="country">
  <option value="usa">USA</option>
  <option value="canada">Canada</option>
  <option value="uk">UK</option>
</select>

This creates a dropdown menu where users can select their country from the available options.

  1. Textarea:
    The <textarea> element creates a multi-line text input field for users to enter larger blocks of text.
<textarea name="message" rows="4" cols="50" placeholder="Enter your message"></textarea>

This creates a textarea where users can enter their message with four visible rows and a width of 50 characters.

  1. Submit Button:
    The <input> element with type="submit" creates a button to submit the form data.
<input type="submit" value="Submit">

This creates a submit button with the label “Submit” that users can click to submit the form.

These are just a few examples of HTML form elements. There are additional elements like file input (<input type="file">), range input (<input type="range">), date input (<input type="date">), and more, each with their own specific use cases. You can combine these elements and customize them to create interactive and user-friendly forms.

HTML Form Elements

TagDescription
<form>Defines an HTML form for user input
<input>Defines an input control
<textarea>Defines a multiline input control (text area)
<label>Defines a label for an <input> element
<fieldset>Groups related elements in a form
<legend>Defines a caption for a <fieldset> element
<select>Defines a drop-down list
<optgroup>Defines a group of related options in a drop-down list
<option>Defines an option in a drop-down list
<button>Defines a clickable button
<datalist>Specifies a list of pre-defined options for input controls
<output>Defines the result of a calculation
Join the conversation