unfiled → data
pending → closed
I put together this live test case which shows everything is working as expected. The data that was set with
.data() is correctly removed.
I think there may be a slight misunderstanding on what
.removeData() does in the case of data-* attributes. The removeData() documentation reads:
The .removeData() method allows us to remove values that were previously set using .data().
and for data-* attributes reverts
to the value of the data attribute of the same name in the DOM
.removeData() is never going to "remove" the actual data-* HTML attribute, which it also isn't supposed to as the original value wasn't set by
I included some more code in the test case which you can uncomment and play around with to get a better understanding of how
.removeData() and data-* attributes play together.