I have a script that replaces a text result value and modifies the CSS depending on what is displayed
jQuery:
setInterval(function() {
$('.monthappend').each(function() {
var text = $(this).text();
$(this).text(text.replace('$0', 'CUSTOM'));
if ($(this).text() == 'CUSTOM') {
$('.monthappend').addClass('without-after-element');
} else {
$(this).removeClass("without-after-element")
}
});
}, 1000);
HTML:
<div id="s0r16c4" class="monthappend"></div>
Currently on my site the function works for most <divs> with the class set except one.
I'm not really sure what is going wrong with it but I can see on inspector that the function does not fire off on it, to test the error input 100 in the first and 1000 in the second and you'll see on the 2nd column with the "/mo" missing from the value