vibecodai logovibecodai
← All HTML lessons

HTML · Lesson 6 · 12 min

Forms Basics

Collect input with form, input, and button.

You will learn

  • Build a simple form
  • Use labels for accessibility
  • Add text inputs and buttons

Forms let users send data. Every input needs a <label> linked with for/id so people know what to type.

Button types

Use type="submit" for the main action. type="button" is for other clicks (handled later with JavaScript).

Edit HTML — live preview below

HTML
Live preview

Tip: Add a textarea for a message with label "Message".