You need to be using
But if you still wanna use
attr() then use this:
$(this).attr('selected', 'selected'); // your method is also OK!
P.S, please check that whether the
select tag has the
multiple attribute in it or not ;) since that might be the
cause of the problem.
Since in this fiddle: http://jsfiddle.net/afzaal_ahmad_zeeshan/tusUA/1/ by
Kevin, you can see the
multiple attribute applied to the
select and the code is working.