📄

Forms (Basic)

Beginner
70 XP
20 min
Lesson Content

Forms (Basic)

Forms collect information from users, like a paper form. The <form> element groups inputs, and inputs capture text, choices, or buttons.

Simple Form

<form action="/submit" method="post">
  <label>Name: <input type="text" name="name" /></label>
<label>Email: <input type="email" name="email" /></label>
  <button type="submit">Send</button>
</form>

For this course we'll focus on HTML structure; handling submissions happens on the server.

Example Code

Create a small form with name and email fields and a submit button.

<!DOCTYPE html>
<html>
  <head>
    <title>Form Practice</title>
  </head>
  <body>
    <!-- Create a form with name and email inputs and a submit button -->
  </body>
</html>

Expected Output:

A form with name and email fields
Study Tips
  • Read the theory content thoroughly before practicing
  • Review the example code to understand key concepts
  • Proceed to the Practice tab when you're ready to code