I have a drop down like below which displays 10,20,30,40
<select>
<OPTION value="10" label="10"> 10 </OPTION>
<OPTION value="20" label="20"> 20 </OPTION>
<OPTION value="30" label="30"> 30 </OPTION>
<OPTION value="40" label="40"> 40 </OPTION>
</select>
It will display 10 as selected and when we click on dropdown, 10,20,30,40.
If 20 is selected, It will display 10 as selected and when we click on dropdown, 10,20,30,40.
Now I have to implement like, if 20 is selected, display it as selected, but in dropdown, display only 10,30,40. 20 should be displayed only in selected place.
Is there any way to implement this functionality?
No, HTML does not offer such an input element that is able to do so.
You might be able with CSS using the attribute selector on the
selectedattribute of<OPTION>and set display to none. That might trick the browser.