I have dynamically created buttons, and I wish that when you click on them you get your value
to be able to interact with it.
@for (int i = 0; i < pagesMax; i++)
{
<input type="button" value=@(i+1) class="bottom" id="id" />
}
I was trying something like this but it did not work for me:
@section scripts
{
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#id").click(function () {
alert($("#id").attr("value"));
});
});
</script>
}