I am trying to apply class to all date items in a loop. My code is working but i am 100% sure that they way i wrote code is not right. Could some on suggest on the code changes. I want to use a FormatDateTime function(my own function) on date item in a loop. As this is a class can we get rid of .each loop in jquery?
for (int i = 0; i < Value.Count; i++)
{
<tr>
<td class="ModificationDate">@MDate</td>
<td>@Action</td>
<td>@Field</td>
<td>@Value</td>
</tr>
}
<script>
$(document).ready(function () {
$("[class=ModificationDate]").each(function () {
$(this).text(FormatDateTime($(this).text()));
});
});
</script>