I have some checkboxs with the same name but each has a unique value. I want that on any click on specific checkbox to get the unique value of the cpecific clicked checkbox.
@foreach (var itert in Model.collec)
{
@Html.CheckBox("chkResend",
new { @value = Html.Encode(itert.EventNumber),
@class = "myclass" })
};
the jquery is:
$(document).ready(function () {
$(".myclass").click(function () {
alert($(".myclass").attr("value"));
});
});
all the time I get the value of the first checkbox...