JQuery: showing elements with a particular title
Posted
by Joe Smalley
on Stack Overflow
See other posts from Stack Overflow
or by Joe Smalley
Published on 2010-04-03T11:15:49Z
Indexed on
2010/04/03
11:23 UTC
Read the original article
Hit count: 239
I am trying to show only elements that have the title attribute passed to the function:
var selectservice = function(serviceStr) {
$j("li.project").hide();
$j("li.project.attr('title').contains(serviceStr)").show();
};
I am not quite sure how to compare the title attribute to the passed string serviceStr? contains doesnt seem to work.
© Stack Overflow or respective owner