Open In App

Which input type is used to hide the input field to be displayed in HTML Form ?

Last Updated : 14 Jan, 2022
Like Article

The form tag is generally used to create forms for entering data. We can use different form tag attributes like text boxes, text area, checkboxes, radio buttons, buttons, dropdown list, etc. to collect data from the users.

We need to use the HTML <input type=”hidden”> type for hiding the input field. Using this attribute, the input field will no longer be visible on the page. The below example demonstrates the usage of the hidden attribute.

Example: In this example, we will use a normal input with the type of ‘text’ and another input with the type of ‘hidden’. This will help to demonstrate how the input field is hidden.


<!DOCTYPE html>
        <h1 style="color: green;">Geeksforgeeks</h1>
        <strong>Login to Continue your Research</strong>
        <!-- This input will be visible as it
              has the type set as 'text' -->
        <input type="text" 
               placeholder="enter your name">
        <!-- This input will be hidden as it
              has the type set as 'hidden' -->
        <input type="hidden" 
               placeholder="Enter your password">


HTML <input type=”hidden”>

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads