I duplicate values checkpoint to another block. By clicking on the new element, it must be removed and the filter selection, too. Please help find the mistake.
$('.views-exposed-widget').on('change', 'input', function () {
var self = $(this),
name = this.name,
text = self.closest('.form-type-radio').find('label[class="option"]').text(),
target = $('.duplicate-filter').find('[data-for="'+ name +'"]');
if (target.length == 0){
target = $('<span class="o_filt" data-for="'+name+'"></span>').appendTo('.duplicate-filter');
}
target.text( text );
$('.o_filt').on('click', function(){
var l = $(this).text();
m = $('.views-exposed-form .form-type-radio label.option');
$(this).remove();
m.each(function(){
if($(this).text().indexOf(l)!=-1){
$(this).closest('input[type="radio"].dls-radio').removeAttr('checked');
}
});
});
});
Example: http://jsfiddle.net/e59ogp8a/5/