Chrome not refreshing multi select element

Y©R

New Member
I have a very simple element in my HTML of:\[code\]<select multiple="multiple" size="19" name="Title[book_types_array][]" id="Title_book_types_array"> <option value="http://stackoverflow.com/questions/15547319/0">None Selected</option> <option value="http://stackoverflow.com/questions/15547319/1" selected="selected">Textbook School</option> <option value="http://stackoverflow.com/questions/15547319/2">Textbook Undergraduate</option></select>\[/code\]And I have a bit of JQuery which magically allows for single click mutliple selections:\[code\]$('select[multiple] option').click(function(e){ var self = $(this); e.preventDefault(); if (self.attr('selected')) self.removeAttr('selected'); else self.attr('selected', 'selected');});\[/code\]And this works just dandy on Firefox but not Chrome.It technically works on Chrome but it does not refresh the element. As an example I select two options and then de-select them, it still shows them as selected. However, when I select a new option in the element it will now refresh and de-select the two elements correctly that I un-selected earlier. It will also refresh the element if I click on another window and then back again.Is this some kind of bug in Chrome with this element or is there something I am missing?EditBy looking in console I can see how it is taking off the selected attribute, it just is not refreshing the element.Added example: http://jsfiddle.net/Udf5c/
 
Back
Top