Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

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

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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:


My Personal Notes arrow_drop_up
Last Updated : 02 Feb, 2022
Like Article
Save Article
Similar Reads
Related Tutorials