How to Disable a Button in HTML
In this article, we will see how to disable a button in HTML. We can create button using <button> or <input> tag. In both methods, using the “disabled” attribute will disable the button.
After we create a form and users fill the form completely, we should remove disable a button
How to make disable button
<!DOCTYPE html>
<html>
<head>
<title>disable button</title>
</head>
<body>
<button disabled>Submit</button>
<input disabled type="button" value="Submit">
</body>
</html>
Output:
Steps:
- In the above code, we have written the general HTML syntax and the title is set to “disabled button”.
- In the body section, we have created two buttons using the button and input tag.
- See the above code, We have used the “disabled” attribute for both tags.
- See the above given output, both buttons have disabled.