I have a simple span like so
Remove
This span is within a table, each row has a remo
You could try jQuery.data(): http://api.jquery.com/jQuery.data , but that would mean server-side generated js code to execute when the page loads so that you can store the ids for later reuse (your remove action)
// this part would have to be server 'generated'
// and by that I'm referring to the '=$row_id?>'
$('table .remove').each(function(){
var MyElem = $(this);
MyElem.data('id', =$row_id?> );
MyElem.click(function(){
the_id = $(this).data('id');
// ajax call goes here
});
});