I am new to JQuery. I have searched for a solution but couldn't find any solution. I have 3 select box and the option selected in the first select box needs to removed from the next two select box. I have the code which actually hides the selected option in FF and chrome. But in IE it is not getting hidden. Also i need to bring back the selected option, if the user changes his mind and re-select the option he has already selected in first select box. Can someone help me out. Any help is much appreciated.
var array= [];
$(document).ready(function(){
$('select').on('change', function(event ) {
$('select').not(this).find('option').show();
var value = $(this).val();
//alert(value);
array.push(value);
for (var i = 0; i < array.length; i++) {
// Here i am disabling the option as well as hiding. Because in IE hide does not work.
$('select').not(this).find('option[value="'+array[i]+'"]').attr('disabled','disabled').hide();
}
});
});