Skip to content

Instantly share code, notes, and snippets.

@drei01
Created November 21, 2013 12:58
Show Gist options
  • Save drei01/7581152 to your computer and use it in GitHub Desktop.
Save drei01/7581152 to your computer and use it in GitHub Desktop.
$('.filter-name').keyup(function () {
if (this.value) {
$('#available-mps .mp').hide();
$('#available-mps .mp[data-name^="' + (this.value.replace(/(?:^|\s)\w/g, function(match) {return match.toUpperCase();})) + '"]').show();
} else {
$('#available-mps .mp').show();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment