Tsallaka zuwa abun ciki
Justice Tech School

Form Attributes

action is the address that receives the data and method is how it is sent. GET puts the values in the URL and suits searches. POST sends them in the request body and suits anything private or that changes data.

Every field needs a name, or its value is not sent. autocomplete helps browsers fill in known details.

Example
<form action="/search" method="get">
  <label for="q">Search</label>
  <input id="q" name="q" type="search" autocomplete="off">
  <button>Go</button>
</form>

Exercise

Send private data in the request body.

<form method="">

Quiz Test

What happens to an input without a name attribute?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.