So jquery api says the following:
Removing data from jQuery's internal .data() cache does not effect any HTML5 data- attributes in a document; use .removeAttr() to remove those.
I have no problem removing a single data-attribute.
<a title="title" data-loremIpsum="Ipsum" data-loremDolor="Dolor"></a>
$('a').removeAttr('data-loremipsum');
The question is, how can I remove multiple data-attributes?
More details:
The starting point is that I have multiple ( let's say.. 60 ) different data-attributes and I want to remove all of them.
Preferred way would be to target only those data-attributes that contain the word
lorem
. In this caselorem
is always the first word. (or second if you countdata-
)Also I'd like to keep all the other attributes intact