HTML DOM Input Hidden Object

Input Hidden Object

The Input Hidden object represents the HTML <input> element with type="hidden".

Access Input Hidden Object

You can use getElementById() to access the <input> element with type="hidden":

var x = document.getElementById("myInput");

Try It Yourself

Tip:You can also search the form for elements collection to access <input type="hidden">.

Create Input Hidden Object

You can use the document.createElement() method to create an <input> element with type="hidden":

var x = document.createElement("INPUT");
x.setAttribute("type", "hidden");

Try It Yourself

Input Hidden Object Properties

Attributes Description
defaultValue Set or return the default value of the hidden input field.
form Return a reference to the form that contains the hidden input field.
name Set or return the name attribute value of the hidden input field.
type Return the form element type of the hidden input field.
value Set or return the value attribute of the hidden input field.

Standard attributes and events

Input Hidden object supports both standardAttributesandEvents.

Related Pages

HTML Tutorial:HTML Form

HTML Reference Manual:HTML <input> Tag

HTML Reference Manual:HTML <input> type Attribute