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.
HTML
<!DOCTYPE html>
< html >
< body >
< form >
< h1 style = "color: green;" >Geeksforgeeks</ h1 >
< strong >Login to Continue your Research</ strong >
< br >
< label >Username</ label >
< input type = "text"
placeholder = "enter your name" >
< br >
< label >Password</ label >
< input type = "hidden"
placeholder = "Enter your password" >
< br >
< button >Submit</ button >
</ form >
</ body >
</ html >
|
Output:
