<?xml version="1.0" encoding="utf-8"?>

The name attribute

The name attribute

So users fill a field, but where does this information go afterward? The point of forms is to collect data, of course. For a server to correctly identify the data in the fields, each input needs the <name> attribute. For example, set the name attribute's value to "email" for a field that collects users' emails.

JavaScript requires the name attribute to be unique among the forms in a document and not be an empty string.

Improve your UX & Product skills with interactive courses that actually work