I have a text input search that is supposed to filter divs based on the title of the div. Here is the code that is not working:
$(\'.contact-name\').each(fun
The find method takes a JQuery selector as parameter. I doubt your search_criteria text input will contain that. Assuming it will contain some substring of the DIV's title, then try this:
var txt = $('#search-criteria').val();
$('.contact-name').each(function(i, e){
if($(e).attr("title").indexOf(txt)>=0) $(e).show();
});