Skip to content

Instantly share code, notes, and snippets.

@fodra
Created August 31, 2017 00:24
Show Gist options
  • Save fodra/bd9d4ec82de59958b7fc993f321a39dd to your computer and use it in GitHub Desktop.
Save fodra/bd9d4ec82de59958b7fc993f321a39dd to your computer and use it in GitHub Desktop.
+ // Write on keyup event of keyword input element
+ $("#search").keyup(function(){
+ _this = this;
+ // Show only matching TR, hide rest of them
+ $.each($("#teamTable tbody tr"), function() {
+ if($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1)
+ $(this).hide();
+ else
+ $(this).show();
+ });
+ });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment