Iran58
شنبه 25 بهمن 1399, 17:00 عصر
سلام
من کد زیر را نوشته ام
<script>
$('#addTr').on('click',
function () {
var number = $('#dt tr').length;
$('#dt').append('<tr><td>' +
number + '</td><td>@Html.DropDownList("TypeId", new SelectList(ViewBag.Type, "TypeId", "Name"), "",
new { @class = "form-control", style = "width:100%" })</td><td> <a id="addTr" class="btn btn-warning rounded mr-0 fileDel"><span class="font-weight-light p-1" style="font-size: 14px; color: #fff">حذف سطر</span><i class="fal fa-trash"></i></a></td></tr>');
});
</script>
ارور زیر را می دهدUncaught SyntaxError: Invalid or unexpected token
باید کد را چگونه بنویسم تا مشکلم برطرف شود
من کد زیر را نوشته ام
<script>
$('#addTr').on('click',
function () {
var number = $('#dt tr').length;
$('#dt').append('<tr><td>' +
number + '</td><td>@Html.DropDownList("TypeId", new SelectList(ViewBag.Type, "TypeId", "Name"), "",
new { @class = "form-control", style = "width:100%" })</td><td> <a id="addTr" class="btn btn-warning rounded mr-0 fileDel"><span class="font-weight-light p-1" style="font-size: 14px; color: #fff">حذف سطر</span><i class="fal fa-trash"></i></a></td></tr>');
});
</script>
ارور زیر را می دهدUncaught SyntaxError: Invalid or unexpected token
باید کد را چگونه بنویسم تا مشکلم برطرف شود