$('select').change(function($this){ console.log($this); $($this.target).children().attr('selected' ,false); $($this.target).children(':selected').attr('selected' ,true); })