HTML <input type=”hidden”>

The HTML <input type=”hidden”> element defines a hidden input field. Hidden fields store data that are not visible or modifiable by users when they submit a form. They are useful for including data that needs to be sent with the form but does not need to be displayed.

Syntax

<input type="hidden"> 

Example: This example demonstrates the use of HTML <input type=”hidden”> element.

html
<!DOCTYPE html>
<html>

<head>
    <title>
        HTML Input Type Hidden
    </title>
</head>

<body>
    <h2>HTML &lt;input type="hidden"&gt;</h2>

    <form action="#">
        <input type="hidden" id="myFile" value="1234">

        <label for="heading">Enter Heading:</label><br>
        <input type="text" name="heading" id="heading">
        <br><br>

        <label for="content">Enter Paragraph:</label><br>
        <textarea name="content" id="content"></textarea>
        <br><br>

        <label for="content">Enter Meta Description:</label><br>
        <textarea name="content" id="content"></textarea>
        <br><br>

        <input type="submit" value="Create Post">
    </form>
</body>

</html>

Output

Supported Browsers

The browsers supported by <input type=”hidden”> are listed below:

  • Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 2
  • Safari 1

Contact Us