Hi there,
I have the following jQuery which only seems to work when I do a hard refresh on a page.
$(document).ready(function() {
jQuery('.single-listing-description .job_description h3:contains("Free")').html(function() {
return $(this).html().replace('Free', '<span class="free-tag">Free</span>');
});
jQuery('.single-listing-description .job_description h3:contains("Win")').html(function() {
return $(this).html().replace('Win', '<span class="win-tag">Win</span>');
});
});
I’ve tried wrapping it in a document ready function, but it still requires a hard refresh.
Can anyone suggest a reason why this would be?
I am basically trying to wrap two words in a H3
title in a tag which the above jQuery does, but could this be done is CSS? I couldn’t seem to find something that does similar to :contains
in jQuery in CSS.
Thanks