Using arrays in Jquery
- by Tom
Here is a code:
<input type="button" id="array[1]" value="Value1" />
<input type="button" id="array[2]" value="Value2" />
<input type="button" id="array[3]" value="Value3" />
And I want to do something like that:
$('#array').click(function() {
id = this.id;
$.ajax({
here goes type, url, data and else
});
})
I want to id add array's number. For example, if I click button where id is array[3] so id gets value of 3 in Jquery's function. Hope you got what I mean.