A question about html select tags-- I'm here to give you another problem.

problem description

well, the customer puts forward a requirement for the drop-down selection box on the page, which is as follows:

clipboard.png

clipboard.png

"..."

selectoptionoptiondisabled
bootstrap-selectapiselectselect2


select2


select2

clipboard.png

what result do you expect? What is the error message actually seen?

I would like to ask if there is any other way to achieve this effect besides using plug-ins. Thank you.

Nov.22,2021

<select name="" id="">
    <option value="" style="display: none"></option>
    <option value="0">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
</select>

A relatively simple method is as above: use display: none to hide the first option. By default, you will still get the first option label to show.
other methods, you can use input to achieve a select . By clicking on the event to control the display of the drop-down menu and maintain the selected state, you can control the performance of this control at will.


upstairs is feasible, agree

Menu