I can't seem to find a simple way to do this.
$('.section').removeAllAttr() would be nice.
$('.section').removeAttr() doesn't work where I thought it might.
So,
...results in...Code:<div class="section hello" data-test="123" id="an-id" data-something="abc"> content </div>
It needs to work for any tag as well.Code:<div> content </div>
Surely this should be easy but I just can't do it.
If it's easier (or quicker for jQuery) then removing all the data- attributes is fine, as I could then do this:
...which would be fine for what I need.Code:$('.section').removeAllDataAttributes().removeClass();



Reply With Quote





Bookmarks