Removing Attributes in jQuery
If you want to remove an attribute completely, you should use the removeAttr method. Let's see how it works with the following example. Let's say we have an input:
<input type="text" value="!!!" id="test">
To remove the value attribute, we write it in the method variable removeAttr.
$('#test').removeAttr('value');
Now in the HTML code the attribute value is no longer there:
<input type="text" id="test">
Add all li class www if it doesn't exist, and remove it if it does.
Remove class www from li.