javascript - Remove :checked from the input with the text of the button -
i duplicate values checkpoint block. clicking on new element, must removed , filter selection, too. please find 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/
use .prop('checked', false)
so:
$('.o_filt').on('click', function () { var l = $(this).text(); $(this).remove(); $('input[name="' + $(this).data('for') + '"]').prop('checked', false); });
Comments
Post a Comment