How to set the drop-down box option in html to be unselectable

青灯夜游
Release: 2021-12-13 16:56:24
Original
6991 people have browsed it

In HTML, you can disable the specified option and make the specified option unselectable by setting the disabled attribute to the option tag element. The syntax is "" .

How to set the drop-down box option in html to be unselectable

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

In HTML, you can make the option unselectable by setting the disabled attribute to the option tag element.

The disabled attribute specifies that an option should be disabled. Disabled options are neither available nor clickable.

Syntax:

<option disabled="disabled">
Copy after login

Example:

Copy after login

How to set the drop-down box option in html to be unselectable

Application: can be set to disabled Property that restores the user's use of the option until certain conditions are met (such as selecting a checkbox). You can then use JavaScript to clear the disabled attribute so that the option becomes available.

Recommended tutorial: "html video tutorial"

The above is the detailed content of How to set the drop-down box option in html to be unselectable. 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!