HTML <input type="hidden">

Last Updated : 25 May, 2026

The HTML <input type="hidden"> element is used to store hidden data in a form that is not visible to users. It is commonly used to send additional information during form submission.

  • Used to store hidden form data that is not displayed on the webpage.
  • Created using <input type="hidden"> inside a form.
  • Supports attributes like name, value, and id.

Syntax:

<input type="hidden"> 

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>
Comment