I create a grid in C# MVC 3. and place a delete button in every rows in the grid.
Please see my image below.
Delete button code.
<td>
<button id="removefromcart" type="button" name="removefromcart"
class="remove-cartitem" value="@(item.Id)"> </button></td>
Script :
<script type="text/javascript">
$(document).ready(function () {
$('[name="removefromcart"]').click(function () {
alert('clicked');
});
})
I try to alert the value of the clicked button.
Please help