I want this to happen if it contains "Thing " (Thing 1, Thing 2) but not if it says "Things"
$("nav#breadcrumbs:contains('Thing')").append("<p>I'm a Thing</p>");
I want this to happen if it contains "Thing " (Thing 1, Thing 2) but not if it says "Things"
$("nav#breadcrumbs:contains('Thing')").append("<p>I'm a Thing</p>");
Couple different formatting options, but the key is that you want to use the not
selector in combination with :contains
:
$("nav#breadcrumbs:contains('Thing'):not(:contains('Things'))").append("<p>I'm a Thing</p>");
$("nav#breadcrumbs:contains('Thing')").not(":contains('Things')").append("<p>I'm a Thing</p>");