In html, you can make the button unavailable by setting the disabled attribute to the input or button tag; the syntax format is "" or "
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
In HTML, you can disable the button element by setting the disabled attribute on the input or button tag, thereby making the button unavailable.
The disabled attribute of the input or button tag
The disabled attribute specifies that the button is disabled.
Disabled buttons are neither available nor clickable.
You can set the disabled attribute to restore the user's use of the button until certain conditions are met (such as selecting a checkbox). You can then use JavaScript to clear the disabled attribute so that the text area becomes available.
Grammar:
<input disabled="disabled" /> <button disabled="value"></button>
Example:
<html> <body> <input type="button" value="Button" disabled="disabled" /> <button type="button" disabled="disabled">Click Me!</button> </body> </html>
Recommended tutorial: html video tutorial
The above is the detailed content of How to disable button in html. For more information, please follow other related articles on the PHP Chinese website!