Open In App

Which attribute is used to disabled the specific input field in HTML Form ?

Improve
Improve
Like Article
Like
Save
Share
Report

HTML5 introduced many attributes that are used for developing an efficient webpage. 

In this article, we will learn to disable the particular input field by using the “disable” attribute with the specific type of input. The disabled attribute is a boolean attribute that is used to vandalize the input field. A disabled input is un-clickable and unusable. It is a boolean attribute. The disabled <input> elements are not submitted in the form. 

Syntax:

<input disabled> 

Example: Below HTML code illustrates how to disable a particular input field. 

HTML




<!DOCTYPE html>
<html>
  <head>
    <title>
         Disabled attribute for the input field in HTML Form?
    </title>
    <style>
        h2 
       {
        color:green;
       }
    </style>
  </head>
  
    <body style="text-align:center">    
        <h1 style="color: green;">GeeksforGeeks</h1>
        <h2>Disabled attribute for the input field in HTML Form</h2>
  
         Name: <input type="text" name="value" 
                      value="This input field is disabled" disabled>
         <br></br> Address:
          <input type="text" name="value" value=
                 "Input field is not disabled" >          
          <br></br>
         <input type="submit" value="This button is disabled" disabled>
    </body>
</html>    


Output:



Last Updated : 02 Feb, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads