我想让这段代码工作:
$('#ddl').change(function () {
$('#cont').html('');
var count = getCount($('#ddl').val())
for (var i = 0; i < count ; i++) {
var html = '<div class="display-row">' +
'<div class="display-label">' +
'Vrednost:' +
'</div>' +
'<div class="display-field">' +
'Od: @Html.TextBoxFor(model => model[i].Od) Do:@Html.TextBoxFor(model => model[i].Do)' +
'@Html.ValidationMessageFor(model => model[i].Do)' +
'</div>' +
'</div>';
$('#cont').append(html);
}
});
我只需要在 js 循环中获取i
for的值。model[i]
我怎样才能做到这一点?