Module 6: HTML Forms and Input

HTML Forms

HTML forms are used to collect user input. The form element acts as a container for various types of input elements like text fields, checkboxes, radio buttons, and submit buttons.

Example:


<form>
    <label for="name">Name:</label>
    <input type="text" id="name" name="name">
    <input type="submit" value="Submit">
</form>
            

HTML Input Types

HTML provides various types of input fields, each serving a different purpose:

Try It Yourself

Quiz: Test Your Knowledge

Which input type is used to create a password field?

Coding Challenge

Create a form that collects the user's first name, last name, email address, and includes a dropdown for selecting their country. Add a submit button at the end of the form using the code editor above.