EDIT: IE doesn't handle it nicely! :(
To support IE, you could use:
--DEMO--
$(document).ready(function () {
var con = $('#console');
$('select').change(function () {
/* change also on already selected option */
con.append('- ' + $(this).val() + '<br/>');
//$(this).blur();
}).change().bind('mousedown', function () {
this.selectedIndex = -1;
this.selectedIndex = $(this).find('option:selected').index();
});
});
See if that fits your needs:
--DEMO--
$(document).ready(function () {
var con = $('#console');
$('select').change(function () {
/* change also on already selected option */
con.append('- ' + $(this).val() + '<br/>');
}).change().bind('mousedown', function () {
//on mousedown, clone SELECT element to display current selected value
// this would be empty value otherwise when setting current selected index
// NOTE: seems to be still not as good on IE...
// FF would need to redefine some margin/padding
if (!$(this).data('cloned')) $(this).data('cloned', $(this).clone().css({
position: 'absolute',
pointerEvents: 'none',
top: this.offsetTop,
left: this.offsetLeft,
margin: 0
}).appendTo('body'));
// here set selectedIndex of SELECT element to not defined index
// this would let on change event to be fired in all cases
this.selectedIndex = -1;
}).blur(function(){
// on blur, remove cloned SELECT element and reset specific data object
if ($(this).data('cloned')) {
this.value = $(this).data('cloned').val();
$(this).data('cloned').remove();
$(this).data('cloned', null);
}
});
});