Search code examples
javascripthtmlinternet-explorer

How to hold a HTML select expanded while adding options


I am trying to add options to a select in its onclick event and works fine in Firefox and IE but... IE close the list after filling it although Mozilla holds the list expanded

¿Are there any way to hold expanded the list (or reexpand the list with JavaScript) in IE? (I am using IE 7.0)

Thanks!


Solution

  • No, not far as I know. The IE redraws the part that is changed, and therefore reset the "design" surface. That's why this happens. What you can do, add the options on the onMouseOver event. That should occur before the onClick.

    A good reference on all events for the IE is in the library. http://msdn.microsoft.com/en-us/library/ms535893%28VS.85%29.aspx#