I would like to take the value of an attribute, process it and then replace a PHP variable with the value we receive at the end.
The data attribute is data-id, all I need assistance with is getting the value of data-id into Javascript on a click event, the rest I can do.
An example:
Person clicks an tag with the data-id set as, say, 7. I'd then need to extract that 7 from the HTML code and into a Javascript variable so I can work with said value.
I hope this is clear enough
$(selector).data('id')