Input Types

HTML input type="hidden"

Build a form with the HTML form generator

Submit an extra value without a visible control. It is not secret and users can change it. No visible control or focus target. Treat the submitted value as untrusted input. Use only attributes applicable to this input state; the browser ignores or rejects unrelated constraints. Validate submitted data on the server.

Formal Syntax & Structure

html syntaxhtml
<input type="hidden">

Parameters & Attributes

NameTypeDescription
typeliteral hiddenSelects the hidden input state.
namestringProvides an element-specific name: a form field key, radio group name, named frame, metadata key, slot name or other defined purpose. Its meaning depends on the element; it is not a unique DOM identifier.
disabledbooleanDisables supported controls or elements. Disabled form controls are generally not focusable, validated or submitted. The exact effect depends on the element; disabled="false" still disables.
formform element IDAssociates an eligible control with a form elsewhere in the same document, overriding an ancestor form where applicable. Does not automatically associate descendants of a fieldset.
valueelement-dependent text or numberDefault value or submitted value depending on type. A file input cannot be prefilled with a path.

Return Value

HTMLInputElement

Void form-associated element; no child content. The DOM value and form-submission behavior depend on the input state.

Working Example

Example Snippethtml
<input type="hidden" name="source" value="catalog">
HTML Reference