У меня есть этот код в HTML:
@for (int i = 0; i < Model.Dishes.Count; i++)
{
@Html.EditorFor(f => Model.Dishes[i].Quantity, new { htmlAttributes = new { @class = "form-control text-center lt-spinner", @min ="0", @max = "4", data_spy = "numberOnly", @aria_labelledby = "fr-newDiningForm" } })
}
Блюдо 1: id: имя "Dishes_0__Quantity": "Dishes [0] .Quantity"
Dish2: id: имя "Dishes_1__Quantity": "Dishes [1] .Quantity" vv ..
И я хочу изменить attr max
из Dishes[i].Quantity
на Js:
for (var i = 0; i < dishCount; i++)
{
$("#Dishes[i].Quantity").attr({ "max": number });
}
Но это не сработало.