Using a for loop, I am adding rows to a css table when the page loads using $(".live-mu-table").html(newHtML). The cells have click events associated with them. I am not sure why the click events are not working.
Below is a very simplified version that demonstrated the issue along with a jsfiddle.
Why, when after clicking "test" does the exact same code that was there before not work?
html:
<div class="live-mu-table" >
<div class="live-mu-table-tr">
<div class="live-mu-table-tdq" id="a-1">q1</div>
<div class="live-mu-table-tdspacer1"></div>
<div class="live-mu-table-tda" id="a-3">A3</div>
</div>
</div>
<div id="test1">test</div>
jquery:
$("#test1").click(function() {
$(".live-mu-table").html("");
var newHtML = '<div class="live-mu-table-tr"><div class="live-mu-table-tdq" id="a-1">q1</div><div class="live-mu-table-tdspacer1"></div><div class="live-mu-table-tda" id="a-3">A3</div></div>';
$(".live-mu-table").html(newHtML);
});