$(document).ready(function () { var $items = $('.js-list-item'); $("#presentations-filter").keyup(function () { var $input = $(this); if (!$input[0]['value']) { $items.removeClass('hidden'); } $items.each(function () { $this = $(this); if ($this.text().toLowerCase().indexOf($input[0]['value'].toLowerCase()) !== -1) { $this.removeClass('hidden'); } else { $this.addClass('hidden'); } }); }); });