Open In App

How to specify that a button should be disabled using HTML5?

In this article, we specify a disabled Button by using a disabled attribute in a <Button> Element. A disabled button is un-clickable and unusable. It is a boolean attribute.

Syntax:



<button disabled></button>

Example:




<!DOCTYPE html> 
<html
    <head
        <title>
            How to specify that a button 
should be disabled using HTML5?
  
              </title
    </head
      
    <body
      <center>
        <p>
            <h2>
                GeeksForGeeks
        </h2>
        </p
        <h2>
            How to specify that a button 
should be disabled using HTML5?
        </h2>
          
        <!-- button tag starts from here -->
        <button type = "button" onclick
            "alert('Welcome to GeeksforGeeks')" Disabled> 
            Click Here 
        </button
        <!-- button tag ends here -->
          
    </body
</html>                     

Output:

Supported Browsers are listed below:



Article Tags :