嗨,我想知道如何在嵌套的 foreach 循环示例中添加 javascript if 条件:
function validation(){
@foreach (var region in Model.DefaultDeliver)
{
//js code
if(document.getElementByName('#@( region.Region.RegionName)') != null){
foreach (var country in region.Region.Countries)
{
//js code
if(document.getElementByName('#@(region.Region.RegionName)') != null){
}
}
}
}
}