SkillByAIOpen interactive version →

Lesson 15 / 30

Form Basics

Create forms with the form tag, and choose between GET and POST methods and action URLs.

The form tag

action is where the data is sent; method is how — get (in the URL) or post (in the request body).

<form action="/submit" method="post">
  <input type="text" name="username">
  <button type="submit">Send</button>
</form>

GET vs POST

Use get for searches/filters (visible, bookmarkable URL); use post for anything sensitive or that changes data.