I have an HTML dropdown menu. I have a jquery .live()
'click' event listener attached to the select element.
In Chrome, it seems that the event fires after I click an option. So if I click it just once to drop the menu, the event has not yet fired. I must click one of the options to fire the event.
In Firefox, it seems that the event fires as I drop the menu. I do not need to click an option because the event has already fired.
This has been a bug in my code for 2 years. I have avoided fixing it by working in a very small shop, but I finally zoomed in close enough to see this up close. I am in conflict since I feel as though this is a discrepancy but I am seasoned enough to know the odds are that I don't understand something.
Edit: adding some code. I can't add the whole page.
<td class="action">
<select id="action_x1" class="action_selector">
<option value="one">one</option>
<option value="two">two</option>
</select><button id="action_x1">commit</button>
</td>
Then the javascript:
$(".action_selector").live({
'click': function (){ show_action_edit_form( $(this) ); }
});
function show_action_edit_form( element ){
console.log("oh, you clicked me.");
}
.on('change',[...]
. That should fix it. The event should fire in all browsers after a value is selected.