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

115
Views
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
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!