(function ($) { $.fn.filtre = function () { let value = $(this).val().toLowerCase(); let target = $(this).data('target'); $(target + " tr").filter(function () { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) }); }; }) (jQuery); (function ($) { $.fn.filtreParNote = function () { this.each(function() { $(this).val("0"); $(this).change(function(e) { let value = $(this).val(); let target = $(this).data('path'); console.log(value); $(target + " tr").filter(function () { $(this).toggle($("td input.rating", this).val() >= value); }); }); }); } }) (jQuery);