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

153
Views
Put value dynamically at Jquery HTML tag

I want to put value of ID at html tag of jquery, here's my code :

var numCols = 1;
$.each(date, function(i) {
        if (!(i % numCols)) tRow = $('<tr>');

        tCell = $('<td>').html(i + 1);
        $('#result').append(tRow.append(tCell));
        tCell = $('<td>').text('Due Date');
        $('#result').append(tRow.append(tCell));

        tCell = $('<td>').html(date[i]);
        $('#result').append(tRow.append(tCell));

        tCell = $('<td>').text('Start Showing On');
        $('#result').append(tRow.append(tCell));

    tCell = $('<td>').html('<button type="button" system-id="$(i + 1)">Preview</button>'); $('#result').append(tRow.append(tCell));

I want to put ID dynamically at system-id --> system-id="$(i + 1)".
What's wrong with my code?

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!