Created
November 26, 2014 11:01
-
-
Save evansantos/9a51507bbd9a4b48d9b6 to your computer and use it in GitHub Desktop.
Filter a list, elements
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
$(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