I have this <td class="foo">dada</td>
and when clicked it triggers an event and it works fine.
and I have this <select>
tag that when the selected option changes the text in the <td class="foo">
change too but when the <td>
is changed the click event of that element doesn't trigger here's a sample code
<select class="chuchu">
<option value="1">1</option>
<option value="2">2</option>
</select>
<table id="tbl">
<tbody>
<tr>
<td class="foo">dada</td>
</tr>
</tbody>
</table>
and here's the script codes that trigger the event click on <td>
<script type="text/javascript">
$('.foo).on('click',function(){
window.open('url', '_blank');
});
</script>
and this is the script for change event in <select>
tag this works fine i just added this for reference for the select tags
$(".chuchu").on("change", function(){
var _val = $(this).val();
$.ajax({
url:"sort_date_attendance.php",
type: "POST",
data: {data:_val},
success:function(response){
data = JSON.parse(response);
$("#tbl tbody").html('');
var html = '';
for (var i=0; i< data.data.length; i++){
html +='<tr>'+
'<td class="foo">'+data.data2[i].stud_lastname+' '+data.data2[i].stud_firstname+'</td>'+
'</tr>';
}
$("#tbl tbody").html(html);
}
});
});
</script>