I have a Bootstrap modal on my site that is launched once on the homepage to direct the user to the appropriate section of the site. The code with the data attributes can be see in a previous question I recently posted.
I just realized that when I click on a link, the data attributes are passed into the modal as expected, but if I close the modal to click a different link, the previous data is still in cache and is being entered into the new link along with the new link values.
In order to try and clear the modal values, I looked at other posts but can't seem to get it to work. Below is one of my many non-working efforts.
$(".modal").on("hidden.bs.modal", function(){
$('.modal-content a').removeData('category', 'subcategory');
});