HTML Attributes

HTML value attribute

Build a form with the HTML form generator

Sets an initial form value, a submitted option value, a list item ordinal or a numeric meter/progress value depending on the element. Current control state may differ from the content attribute. Applicable elements include: <button>, <data>, <input>, <li>, <meter>, <option>, <progress>. Check each element’s value rules.

Formal Syntax & Structure

html syntaxhtml
value="2"

Parameters & Attributes

NameTypeDescription
valueelement-dependent text or numberSets an initial form value, a submitted option value, a list item ordinal or a numeric meter/progress value depending on the element. Current control state may differ from the content attribute.

Working Example

Example Snippethtml
<label>  Quantity  <input type="number" name="qty" value="2"></label>
HTML Reference