Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

109
Views
jQuery works on other elements except one

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.

Example link

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!