I have the following ForEach in my razor where i am setting some values.
It works fine. I can see my all values.
@foreach (var item in Model.ConsultantDetails.ScopeOfSevrices)
{
<div id="optionValue" class="item" data-value=>@item.Name</div>
}
Then i have an ajax call and get the result back.
I want to set this data back to same DIV by iterating
$.each(data.ConsultantDetails.ScopeOfSevrices, function (index) {
$('optionValue').attr("data-value=>", data.ConsultantDetails.ScopeOfSevrices[index].Name);
});
No luck, how do i achieve that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…