Thanks Ca-Phun Ung, I tried your suggestion, as you're quite right the apostrophe I was using before was the wrong one. But no luck! I tried this: $("li:contains(ladies’ short-sleeve tee)").addClass("selected");
If I change the source to just "ladies' short-sleeve tee" and then use $("li:contains(ladies\' short-sleeve tee)").addClass("selected"); It does work, but since it's coming out of a CMS I really don't have that option. I'm totally baffled. I also tried "escape()"-ing and "encodeURI()"-ing the apostrophe and that didn't work either. I wonder if there's a wild-card character I can just stick in there instead? Thanks, Nora On Sep 5, 12:16 pm, Ca-Phun Ung <[EMAIL PROTECTED]> wrote: > nabrown78 wrote: > > I am trying to select a list element that contains the text > > "ladies’ short-sleeve tee". I have tried > > > $("li:contains(ladies' short-sleeve tee)").addClass("selected"); > > $("li:contains('ladies\' short-sleeve tee')").addClass("selected"); > > $("li:contains(ladies’ short-sleeve tee)").addClass("selected"); > > and > > $("li:contains(ladies%27 short-sleeve tee)").addClass("selected"); > > Try this (hope the apostrophe renders correctly when it gets to your end): > > $('li:contains("ladies’ short-sleeve tee")').addClass("selected"); > > Explanation: > > ’ = ’ = ’ != '