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

132
Views
How to call function from appended row and template literals

I'm having problems with calling function.

I have made function that loops through array and appends customer info in each row. I would like to have onclick to call another function and pass one parameter.

  aClanovi.forEach((oClan) => {
    $("#table_body").append(
      `<tr><td>${oClan.Ime}</td><td>${oClan.Prezime}</td><td>${oClan.Sport}</td><td>${oClan.Uloga}</td><td>${oClan.UlogaKraj}</td><td>${oClan.Clanarina}</td><td><a href='#editMemberModal' class='edit' data-bs-toggle='modal'><i class='material-icons' data-toggle='tooltip' title='Edit'>&#xE254;</i></a></td><td><a href='' id='ObrisiClana' onclick='obrisiClana(oClan.OIB)'><i class='material-icons' title='Obrisi'>&#xe872;</i></a></td></tr>`
    );
  });
const obrisiClana = (OIB) => {
  console.log(OIB);
};

Main problem is within this <a href='' id='ObrisiClana' onclick='obrisiClana(oClan.OIB)'><i class='material-icons' title='Obrisi'>&#xe872;</i></a> and onclick.

All customer info's are showing, but I get error whenever I try to press delete button.

Error: 
Uncaught ReferenceError: obrisiClana is not defined
    onclick http://127.0.0.1:5500/index.html?:1```
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!