Created
July 8, 2009 19:59
-
-
Save slackorama/143134 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from | |
// http://stackoverflow.com/questions/1100066/filter-table-from-select-input-using-jquery/1100201 | |
// | |
// basically, filter a table on a page based on rows chosen from a dropdown | |
$('select').change( function(e) { | |
var letter = $(this).val(); | |
$('tr').each( function(rowIdx,tr) { | |
$(this).hide().find('td').each( function(idx, td) { | |
if( idx === 0 || idx === 1) { | |
var check = $(this).text(); | |
if (check && check.indexOf(letter) == 0) { | |
$(tr).show(); | |
} | |
} | |
}); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment