This should be fairly easy but I can't get my head around it. I have googled but can't find answers. I want to be able to capture some data when button A is clicked and submit those data when button B is clicked, via AJAX.
I have been thinking of this:
$(document).on('click', 'button-a', function(){
var captureData = $('available-data').text();
$(document).on('click', 'button-b', function(){
submitData(captureData);
})
})
How can I achieve this?