jeudi 16 mars 2017

Html Checkbox won't check (JQuery)

Please can someone tell me how to make my checkboxes work, generated with the following JQuery code:

var html = '<table width="100%"><tr><th>Include?</th><th>Product ID</th> <th>Product Name</th><th>Detail</th><tr>';

/* from result create a string of data and append to the div */

$.each(productsArray, function (key, value) {

    console.log(key, value);
    html += `<tr><td><input type="checkbox" name="product-id" value="${key}"></td><td>${key}</td><td>${value}</td><td></td></tr>`;
});
html += '</table>';
$("#chart-container").html(html);

I've tried adding

onClick="this.checked=!this.checked;"

as suggested on SO, but that made no difference.




Aucun commentaire:

Enregistrer un commentaire