Results 1 to 5 of 5
Thread: Remove ALL attributes in jQuery
Dec 12, 2012, 11:50 #1
- Join Date
- Sep 2008
- 0 Post(s)
- 0 Thread(s)
Remove ALL attributes in jQuery
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.
<div class="section hello" data-test="123" id="an-id" data-something="abc"> content </div>
<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: