JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test_div">
<a href=http://www.google.com id="test_a">Google</a>
</div>
JavaScript
var a =$('#test_div a') ;
alert(a.attr('id')); //expected : test_a
alert(a.attr('class')); //expected : undefined IE7: null, fine
a.addClass('cls1');
alert(a.attr('id')); //expected9 : test_a
alert(a.attr('class')); //expected : cls1
a.removeAttr('id');
alert(a.attr('id')); //expected : undefined, IE7: null, fine
alert(a.attr('class')); //expected : cls1, IE7: null, WRONG!