1.I run this codes.
<table id="widgetTable" class="table table-hover">
<thead>
<tr>
<th>NO.</th>
</tr></thead> </table>
//skip details
$("#widgetTable > tbody:last").append('<tr><td>'+ (i+1) +'</td></tr>);
//upper code line is succeesed in run time
- But be appended td isnt find in table when using debugging tools of browser (be unchanged source)
- so bottom codes wasnt activited? how can i do! tell me a way.. :(
$( document ).ready(function() {
$('#widetTable').find('tr').click( function(){
var selected = $(this).hasClass("highlight");
$("#widetTable tr").removeClass("highlight");
if(!selected)
$(this).addClass("highlight");
alert('You clicked row '+ ($(this).index()+1) );
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>