Elitmiar
Elitmiar

Reputation: 36839

JQuery onchange Dropdown does not hide/show element

I have a dropdown box (Combobox). Everytime I make a new selection a table element must show or hide depending on my selection. Now my problem is it's working in Firefox but not in IE. The dropdown has an onchange event which calls the JS function below. The tr element has the ID #mainItem.

function toggleMainPageOption(){
                $("#mainItem").toggle();
}

Why does this not work in IE? Am I doing something wrong?

Upvotes: 0

Views: 1128

Answers (1)

Philippe Leybaert
Philippe Leybaert

Reputation: 171764

The onchange event is triggered when the focus is no longer on the dropdown control (so after you press "TAB" or click somewhere else)

More info here:

Javascript onchange different in IE and FireFox

Upvotes: 2

Related Questions