Use the attribute equal to the selector , for example:
var selectservice = function(serviceStr) { $j("li.project").hide(); $j("li.project[title='" + serviceStr + "']").show(); };
Please note that there are other parameters for attributes, and not just equal ones, for example, contains, ends, starts with, etc. See here for a complete list .
source share