Skip to content

Instantly share code, notes, and snippets.

@evansantos
Created November 26, 2014 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evansantos/9a51507bbd9a4b48d9b6 to your computer and use it in GitHub Desktop.
Save evansantos/9a51507bbd9a4b48d9b6 to your computer and use it in GitHub Desktop.
Filter a list, elements
$(function(){
$('.filterField').keyup(function(){
var valThis = $(this).val().toLowerCase();
if(valThis == ""){
$(wvstationsTree.jqId + " ul li").show();
} else {
$(wvstationsTree.jqId + " ul li").each(function(){
var text = $(this).text().toLowerCase();
(text.indexOf(valThis) >= 0) ? $(this).show() : $(this).hide();
});
};
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment