How to add dropdown list in jquery script
hi all below is my jquery script and below of that my dropdown is there i have hardcoded actually so dropdownlist coming but i want to add my dropdownlist already containing data in mvc.finally ia want to add in maintable
function addNextRow(currentEle) {
debugger;
rc++;
if (counter > 10) {
alert("Only 10 Approvers allowed");
return false;
}
$("#maintable tr:last").after("<tr id=lineRow_"+rc+" class='data-contact-person'><td colspan=4></td><td><td><select name=Approver"+rc+" class='form-control Login01 required' data-val='true' id= App1Login, required='required' onchange='getApprover1(this.options[this.selectedIndex].value);' style='width:100%'> </td><td><input name=Approver"+rc+"Name class='form-control Approver1Name text-box single-line' id=ValApp"+rc+"Login readonly='readonly' style='width:100%;' type='text' value=''></td></td><td class='center'><a href='#'><img src='./screen1_files/plus.jpg' id='AddAttr' width='16px' height='16px' title='' alt='' onclick='addNextRow(this);return false;'></a><a href='#'> <img src='./screen1_files/cross.jpg' width='16px' height='16px' title='' alt='' onclick='removerow(this);return false'></a></td></tr>");
counter++;
}
this i my dropdown list in mvc
<td>@Html.DropDownListFor(model => model.Approver1, (IEnumerable<SelectListItem>)ViewBag.Approver, "Select", new { Name = "Approver1", id = "App1Login", onchange = "getApprover1(this.options[this.selectedIndex].value);", @class = "form-control Login01 required", required = "required", style = "width:100%" }) </td>