Link to home
Start Free TrialLog in
Avatar of mike99c
mike99c

asked on

style="display:none" does not work for option element

Hello
I have a select list and I need a way to set certain option tags invisible. I tried applying style="display:none" to the option tags but this has had no effect.
The reason for this is that I am going to use some JavaScript to dynamically enable some selections in the drop down list.
Please see the attached code snippet.
Thanks

<select id="counties" tabindex="1">
 <option value="">Select</option>
 <option style="display:none" value="IE76176089">Carlow</option>
 <option style="display:none" value="IE96268862">Cavan</option>
 <option style="display:none" value="IE55624026">Clare</option>
 <option style="display:none" value="GB55624026">London</option>
 <option style="display:none" value="GB55624026">Surrey</option>
</select>

Open in new window

SOLUTION
Avatar of SteveH_UK
SteveH_UK
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Göran Andersson
Göran Andersson
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Checking back to see if you had any progress?