Home >Web Front-end >HTML Tutorial >Examples of disabling selection and select disabling options in option tags in HTML

Examples of disabling selection and select disabling options in option tags in HTML

黄舟
黄舟Original
2018-05-15 09:50:174695browse

If you don’t want users to choose, you can disable the html option and disable the select option. The following is the specific implementation. I hope it will be helpful to everyone.

The code is as follows:

<select> 
<option value="">1</option> 
<option value="">2</option> 
<option value="">3</option> 
<option value="">4</option> 
<option value="">5</option> 
</select>



I don’t want users to be able to choose 345. What should I do?

The code is as follows:

<select> 
<option value="">1</option> 
<option value="">2</option> 
<optgroup label="3"></optgroup> 
<optgroup label="4"></optgroup> 
<optgroup label="5"></optgroup> 
</select>


This is ok

The above is the detailed content of Examples of disabling selection and select disabling options in option tags 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