can someone help me with this task
@foreach (var item in Model.Premium)
{
<div class="col-md-2">
<div id="test" class="panel">
<div class="panel-heading text-center">
<h1 class="panel-title" style="font-size:x-large;font-weight:400">
@item.year
</h1>
</div>
<div class="panel-body text-center" style="font-size:x-large;font-weight:300">
[email protected]
</div>
</div>
</div>
<script>
var year = @item.cy_year;
var OddOrEven = year % 2;
if (OddOrEven = 0) {
$('#test').addClass("panel-default");
}
else
{
$('#test').addClass("panel-info");
}
</script>
}
In this code I'm getting list of years and prices from a table. What I want is to add each year with it's price in bootstrap panel, then check if the panel is odd or even. For all of the odd panels, I want to add the bootstrap class "panel-default" and for all of the even panels I want to add the bootstrap class "panel-info".
Thanks