Sowmya
Sowmya

Reputation: 26969

Option tag display block/none in Internet Explorer

This is an additional problem to my previous question.

I have a perfect code (DEMO) which works as expected. But this works fine in Chrome and firefox but not in Internet Explorer. That is bcause IE doesn't support disply: none/block for option tags.

To explain the flow of the functionality,

All I need is to get the given code work in Internet Explorer.

Or is there any way to get the same funtionality with ul li instead of list item ?

Upvotes: 0

Views: 96

Answers (1)

Magus
Magus

Reputation: 15104

It's a little unsemantic to just hide an option. There's some browser (Internet Explorer in your case) which can't do that. Your best shot to handle all browsers is to actually remove the option from the DOM, just not hiding it.

Do you want something fun with your demo ? Select Tag 1 as the main tag. Then select Tag 2 as a sub tag. Now play with UP and DOWN arrow on your keboard and feel the magic. So now, can you really say that is a perfect code which works as expected ?

If you want to have a working code, you have to remove and add options in the select. Hiding an option is too weird and not really supported by browsers (even firefox and chrome).

Upvotes: 1

Related Questions