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

200
Views
How do I make my function work also for appended elements?

I have a list of div, with the class "case".

<section class="liste">
    <div class="case">A</div>
    <div class="case">B</div>
</section>

Then, in the script, I append divs with the class "case", following the ones already there :

$(".liste").append("<div class='case'>C</div>");

I have a function, that starts when a class "case" div is clicked :

$(".case").click(function(){
    alert("it works"); }

However, this function works only for the divs already put in the HTML (A, B) but NOT for the appended div (C).

Would you know how to make my function work also for appended elements ?

Thank you.

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!