JSFiddle - React, Tailwind, and code Playground
by Bondy
HTML
<table>
<tr>
<td> hi there <span class="click">click me</span></td>
<tr>
<tr>
<td> hi there2 <span class="click">click me</span></td>
<tr>
<tr class="end">
<td></td>
</tr>
</table>
<button class="add_new">add new row</button>
CSS
.click {
color: #0000ff;
cursor: pointer;
}
.end {
background: #ff0000;
height: 10px;
}
JavaScript
var new_row = '<tr><td> hi there, new row! <span class="click">click me</span></td><tr>';
$('.add_new').click(function() {
$('.end').before(new_row);
});
$('.click').bind('click', function() {
alert('clicked');
});