|
Back to HTMLhtml Lesson 5

Forms & Inputs

Collect user input effectively.

The Form Element

The `<form>` element is used to create an HTML form for user input.

html
<form action="/submit_page.php">
  <!-- input elements go here -->
</form>

Try it yourself:

HTML
CSS
Result

Input Types

The `<input>` element is the most important form element. It can be displayed in many ways, depending on the `type` attribute.

html
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname">

<input type="radio" value="Male"> Male
<input type="checkbox"> I agree

Try it yourself:

HTML
CSS
Result