The value attribute defines a default or associated value for an element. What that means depends on the tag — most often <input>, <button>, <option>, and <li>, plus <progress> / <meter>.
On text-like inputs, value is the initial text. On checkbox/radio and options, it is the data paired with name when the control is selected. Related: type, checked, selected, placeholder.
Baseline · Widely available.
Not deprecated and not experimental. A core form/control attribute supported everywhere modern browsers render HTML.
Not one meaning for every element.
Read value in context of the host tag. Do not confuse it with the obsolete valuetype attribute on <param>.
Syntax
HTML Syntax
syntax.html
<element value="string">
Examples: <input value="Ada">, <input type="checkbox" value="yes">, <option value="us">, <li value="10">. In JavaScript, many controls expose a live .value property.
Values
Attribute Values
The attribute is a string (or number-like string). Common uses:
li value — sets that item’s number in an ordered list; following items continue from there.
progress value — current amount toward max.
Different jobs — always check the element when you see value.
Meter uses value similarly for a scalar gauge.
Edge Cases & Pitfalls
Most confusion is mixing the content attribute with the live IDL property, or forgetting checkbox defaults.
IDL
Attribute ≠ live .value
After typing, input.value changes, but getAttribute("value") may still show the original default. Use defaultValue when you mean the initial string.
checkbox
Missing value → "on"
A checked checkbox without value usually submits on. Set an explicit value for clear APIs.
placeholder
Not a placeholder
placeholder is a hint. Do not use value only to fake a placeholder — it submits as real data.
password
Avoid pre-filling secrets
Putting passwords in HTML value exposes them in source. Leave password fields empty.
valuetype
Different from valuetype
valuetype on <param> is a separate legacy attribute — not everyday form value.
Compatibility
Browser Support
value is a core HTML attribute for form controls and related elements. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
value
Supported everywhere modern browsers render HTML. Safe to rely on for defaults, submitted choice data, list ordinals, and progress measures.
98%Global support (approx.)
Google Chrome1+
Full support
Mozilla Firefox1+
Full support
Apple Safari1+
Full support
Microsoft Edge12+
Full support
Opera4+
Full support
Samsung InternetModern · Full
Full support
Internet Explorer2+
Supported
valueWidely supported
Bottom line: Safe for everyday forms. Remember element-specific meaning, and prefer explicit checkbox/option values over defaults.
Remember
Key Takeaways
Role: default or associated data for a control/element.
Text inputs: initial contents; submit the live field text.
Choices: what is sent when checkbox/radio/option is selected.
Context: same name, different jobs on li / progress.
One line:value is the control’s data — initial text, submitted choice string, or numeric measure — always read it for the element you are on.
Frequently Asked Questions
It depends on the element. On text-like inputs it sets the initial contents. On checkbox/radio and option it is the data sent when that control is chosen. On button it can be included when the form is submitted. On li it can set the ordinal number in an ordered list.
Related but not identical. After the user types, input.value (IDL) is the live contents. The value content attribute often still holds the original default until you change it in the DOM. Use defaultValue for the initial string on many inputs.
If checked and value is omitted, browsers typically submit the name with the value "on".
No. placeholder is a hint that disappears when the user types. value is real control data (default or current).
Common ones: input, button, option, li, progress, meter, and data. Meaning is element-specific — always check the element docs.
No. value is a standard, widely supported HTML attribute. (Do not confuse it with the obsolete valuetype attribute on param.)