On form controls (<input>, <textarea>, <select>, <button>), the name attribute is the key sent with the control’s value when the form is submitted. Treat it as required for any field you want on the server — with no name (or an empty one), the value is not submitted.
The same attribute also groups radio buttons, names a <form>, targets an <iframe>, and pairs with content on <meta>. It is not the same as id — use id for labels and CSS; use name for submission and groups.
Baseline · Widely available.
Not deprecated and not experimental. Supported everywhere modern browsers run forms and metadata.
No name → no submit value.
A beautiful labeled input without name never reaches the server. Always set a clear name on fields you care about.
Syntax
HTML Syntax
syntax.html
<input name="key">
<meta name="metadata-name" content="value">
key is a non-empty string for form controls. Prefer simple tokens like email or user_name.
Values
Attribute Values
A string whose meaning depends on the element:
Context
What name means
Try it
Form controls
Submission key for that field’s value (e.g. email)
Selecting one clears the others in the same name group.
How It Works
Shared name="plan" creates one radio group.
Different value on each option tells the server which choice was made.
Only the checked radio is submitted (as plan=pro, for example).
fieldset + legend keeps the group accessible.
Example 3 — Meta name + content
Document-level metadata uses name for the key and content for the value.
HTML
<head>
<meta charset="UTF-8">
<meta name="description" content="Learn the HTML name attribute for forms and metadata.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML name Attribute</title>
</head>
<meta name> lives in <head> — open Try It Yourself to inspect the full document head.
Common names: description, viewport, author, theme-color.
How It Works
name says which metadata you are setting.
content holds the actual string value.
description often appears in search snippets; viewport helps mobile layout.
Not a form field — this use is document metadata, not submit keys.
Edge Cases & Pitfalls
Most bugs are missing names, mixing up id, or clashing with form APIs.
submit
Missing or empty name
That control’s value is omitted from the form data. Always name fields the server needs.
compare
name is not id
id must be unique in the page. name can repeat (radios/checkboxes). Labels use for → id.
api
Avoid names that clash with form properties
Names like submit, reset, or length can override built-ins on form.elements / the form object.
special
_charset_ and isindex
A hidden input named _charset_ gets the submit encoding automatically. The name isindex is not allowed for historical reasons.
groups
Different radio names = different groups
If each radio has a unique name, they no longer act as one choice list. Share the name within a group.
Compatibility
Browser Support
name is an HTML attribute used across forms, meta, and framing in the browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
name
Supported in all mainstream browsers for form controls, meta, iframe, and related elements.
99%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet ExplorerAll
Supported
nameUniversally supported
Bottom line: Safe to rely on everywhere. Remember: no name means the field value is not submitted.
Remember
Key Takeaways
Forms:name is the submit key for a control’s value.
vs id:id for labels/CSS; name for data and radio groups.
Radios: same name = one group; different value per option.
Meta:name + content for page-level metadata.
One line:name is how the browser labels form data (and some metadata) — without it, submit skips the field.
Frequently Asked Questions
It sets the key used when the control’s value is submitted with the form. Without a name (or with an empty name), that control’s value is not included in the submission.
id uniquely identifies an element in the document for labels, CSS, and getElementById. name is mainly for form submission and for grouping radios/checkboxes. You often need both.
Radios with the same name form one group — only one can be selected. The checked button’s value is submitted under that shared name.
Commonly input, textarea, select, button, and form. Also meta (with content), iframe (as a target name), map, object, param, and others.
Yes. Named controls appear on form.elements (for example form.elements.email). Avoid names that clash with built-in form properties like submit.
On meta, name identifies the kind of metadata and content holds the value — for example name="description" content="…".