Open In App

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

Improve
Improve
Like Article
Like
Save
Share
Report

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:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Last Updated : 18 Jun, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads