JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test"></div>
JavaScript
$('#test').addClass('test').removeAttr('id');
console.debug( $('.test').length );
<div id="test"></div>
$('#test').addClass('test').removeAttr('id');
console.debug( $('.test').length );