How to disable button in html

青灯夜游
Release: 2023-01-06 11:14:32
Original
14187 people have browsed it

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>
Copy after login

Example:

<html>
<body>
<input type="button" value="Button" disabled="disabled" />
<button type="button" disabled="disabled">Click Me!</button>

</body>
</html>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!