var self = this; id_selected = $.grep(id_selected, function(val) { return val != $(self).attr('id'); });