" or ""."/> " or "".">

Home >Web Front-end >HTML Tutorial >How to disable button in html

How to disable button in html

青灯夜游
青灯夜游Original
2021-05-20 13:52:3714242browse

In html, you can make the button unavailable by setting the disabled attribute to the input or button tag; the syntax format is "" or "

How to disable button in html

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>

How to disable button in 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn