jcadima
7/26/2018 - 1:46 PM

Search Filter based


http://jsfiddle.net/chQ2T/4/

<input id="search_field" type="text" placeholder="Search">

<div id = "container">
    <div id = "abc" class = "box">
        ABC        
    </div>
    <div id = "cde" class = "box">
        CDE
    </div>
    <div id = "efg" class = "box">
        EFG
    </div>    
</div>





function hide_divs(search) {
    $("#container > div").hide(); // hide all divs
	$('#container > div[id*="'+search+'"]').show(); // show the ones that match
}

$(document).ready(function() {
	$("#search_field").keyup(function() {
		var search = $.trim(this.value);
		hide_divs(search);
	});
});