I'm trying to use dynamic rows and I have jquery to set dynamic options for a select, so I have HTML code and within it is a jquery, and this HTML I'm trying to use within a script.
Why it is not running? the line is the second one within the cols group.
<script>
$("#addrow").on("click", function () { var newRow = $("<tr>"); var cols = "";
cols += '<td><input type="text" class="form-control" name="actividad' + counter + '"/></td>';
cols += '<td class="col-sm-3"><div class="form-group"><script>$(document).ready(function() {$("#resp_act").change(function(){var respons_act=$("#resp_act").val();});})<\/script><select class="form-control resp_act" style="font: 15px arial;" type="number" name="resp_act' + counter + '" id="resp_act" required></select></div></td>';
cols += '<td class="col-sm-2"><div class="form-group"><div class="input-group date" id="fec_ini_act"><input type="text" class="form-control fec_ini_act" name="fec_ini_act' + counter + '"/><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div></div></td>';
cols += '<td class="col-sm-2"><div class="form-group"><div class="input-group date" id="fec_fin_act"><input type="text" class="form-control fec_fin_act" name="fec_fin_act' + counter + '"/><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div></div></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger "
value="Delete"></td>';
newRow.append(cols);
$("table.order-list").append(newRow);
});
</script>