Hi
I have this function that is used to generate a new row in a table, dynamically. At present in generates input boxes:
$(document).ready(function () {
var counter = 0;
$("#addrow").on("click", function () {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="text" class="form-control" name="Name' + counter + '"/></td>'
cols += '<td><input type="text" class="form-control" name="Description' + counter + '"/></td>';
cols += '<td><input type="text" class="form-control" name="Department' + counter + '"/></td > ';
cols += '<td><button type="button" class="ibtnDel btn btn-md btn-danger "><i class="fa fa-trash-o"></i></button></td>';
newRow.append(cols);
$("table.order-list").append(newRow);
counter++;
});
$("table.order-list").on("click", ".ibtnDel", function (event) {
$(this).closest("tr").remove();
counter -= 1
});
});
How can I add a dropdownlist to be generated here too?