testModel
public class testModel
{
public int ID{get; set;}
public string name{get; set;}
}
cshtml code
@model IEnumerable<testModel>
var lstModel = Model.ToList();
<div id="mainOfferDiv">
@for(int i = 0; i<lstModel.Count(); i++)
{
}
</div
In js file i want to get list of testModel data which is there in cshtml file, I tried with below
js file
var listModel = document.getElementById("mainOfferDiv");
Suppose lstModel contains list of 10data i want to get same in js file
Thank you in advance
var listModel = document.getElementById("mainOfferDiv");you perhaps want to add .childNodes or something?