There is a table with tbody id of: table_tbody
I am trying to add 10 rows with clickable second td in jquery.
I have created one variable: element
which is the <tr>
row with included <td>
s.
This is the part of the code.
for (var ind = 0; ind < 10; ++ind) {
var elem = element.clone();
elem.children().next().first().attr("id", "table_td" + ind.toString());
$("#table_td" + ind.toString()).click({playerID: 0}, playerFunc);
$('#table_tbody').append(elem);
}
As you see I am setting unique id for each row's second td
.
Then I am connecting to it the click event. However the click event is not firing after I click on it.
No errors are shown.
Am I doing it incorrectly?
EDIT: Link to JSFiddle