I'm trying to find connective words in a string of text and convert them from uppercase to lower case.
I've managed to get it working using this:
$(".breadlinks:contains('or')").html(function(_, html) {
return html.replace(/(or)/g, '<span class="smallcaps">$1</span>')
});
But this will work if the word isn't or
but it contains or
like order
, I only want it to wrap the text in smallcaps
class if it exact matches.
Here is a link the the JSFiddle https://jsfiddle.net/zjfrk3nd/16/