Skip to content

Instantly share code, notes, and snippets.

@javierverb

javierverb/.js

Created Oct 21, 2016
Embed
What would you like to do?
A simple and helpfull function for search in any element with the class searchable
(function() {
$('#filter').keyup(function () {
var rex = new RegExp($(this).val(), 'i');
$('.searchable tr:visible').addClass('hide')
$('.searchable tr.hide').filter(function () {
return rex.test($(this).text());
}).removeClass('hide');
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment