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

185
Views
Anonymous function causing id to be blank

I wanted to use DOM elements instead of innerHTML so I changed this

cell3.innerHTML = '<input type="button"  class="blue" onclick="edit(this.id)" value="Edit" id=edit-button' + (i + 1) + '></input>';

into this

var newEl = document.createElement("input");
newEl.className ="blue";
newEl.value= "Edit";
newEl.id="edit-button " + (i + 1);
newEl.type="button";
cell3.appendChild(newEl);
newEl.onclick=function() {edit(newEl.id)};

how do I fix the argument of the function edit becoming null/empty?

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!