Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <input> type="hidden"

The <input> tag with a type="hidden" attribute creates a hidden (invisible) input element.

It is invisible but will be included during form submission.

Example

#

An <input> element of type hidden.
The element is invisible, but its value will be included during form submission.

Edit your address





<form action="/tutorial/action.html">
 <fieldset style="background-color:#f6f8ff;border:2px solid #4238ca;">
   <legend>Edit your address</legend>

   <input type="text" name="street" value="908 Westminster Street"><br /><br />
   <input type="text" name="city" value="Houston"><br /><br />
   <input type="text" name="state" value="Texas"><br /><br />
   <input type="hidden" name="userId" value="3229440">
   
   <input type="submit" value="Submit">
  </fieldset>
</form>

Using input type="hidden"

The <input type="hidden"> creates a hidden input control.

Hidden input elements are not visible, but their values are included during form submission.

Hidden fields are commonly used in web applications that have a database backend.

Tip: Don't store sensitive data in hidden fields because it is easily viewable in the page source.


Syntax

<input type="hidden">

Browser support

Here is when type="hidden" support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <input>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides