Am having a problem with my jquery
i want to delete some products
but the only problem am getting, the deletion works only on first items even if i click the last item
Lets say i want to delete <p>INFO 20002</p>
it will delete <p>INFO 2000</p>
i want to be able to delete any item i want
<script>
function callB() {
$("#button1").click(function(event) {
Execute();
});
function Execute() {
$.ajax({
type: 'POST',
url: 'ajax/file.aspx',
data: {
'custId': $("input[name='custId']").val()
},
success: function(response) {
},
error: function() {
alert("error");
}
});
};
}
$(document).ready(function() {
callB();
});
</script>
<div>
<p>INFO 2000</p>
<input type="button" id="button1" value="Erase this">
<input type="hidden" name="custId" value="348700">
</div>
<div>
<p>INFO 20001</p>
<input type="button" id="button1" value="Erase this">
<input type="hidden" name="custId" value="4443487">
</div>
<div>
<p>INFO 20002</p>
<input type="button" id="button1" value="Erase this">
<input type="hidden" name="custId" value="8883487">
</div>
<div>
<p>INFO 20003</p>
<input type="button" id="button1" value="Erase this">
<input type="hidden" name="custId" value="1113487">
</div>