Skip to content

Instantly share code, notes, and snippets.

@BenJam
Created January 14, 2011 12:35
Show Gist options
  • Save BenJam/779553 to your computer and use it in GitHub Desktop.
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.
//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