Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
Jquery Event on div creation or content change

I have a form, with the following div created when there is an error on the email field when we submit the form. Meaning the div doesn't exist is the original form.

<div for="email_rappel" generated="true" class="mage-error" id="email_rappel-error">
'Please enter a valid email address.'</div>

I would like to make an event when the div is created..in order to do that, I've tried the following; but seems like nothing is triggered the log never happens and can't tell why.

        var emailError = jQuery('#email_rappel-error');
        emailError.bind('DOMNodeInserted DOMSubtreeModified DOMNodeRemoved', function(event) {
            console.log("test");
            if(emailError.text() === "'Please enter a valid email address.'"){
                //do something
            }
        });

Any suggestion ?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda