Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

112
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda