Created
January 14, 2011 12:35
-
-
Save BenJam/779553 to your computer and use it in GitHub Desktop.
Very simple searcher show/hiding elements of the dom onChange for an inpux search box.
This file contains 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
//searchController | |
function search(){ | |
var searchTerm = $('#search').text(); | |
$.forEach(elemement, $('#questions > li')){ | |
if(!element.text().match(searchTerm)>0){ | |
element.hide(); | |
}else( | |
element.show(); | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment