JSFiddle - React, Tailwind, and code Playground
HTML
<div id="t1"><span>t1</span></div>
<div id="t2"><span>t2</span></div>
<div id="t3"><span>t3</span></div>
JavaScript
$(document).ready(function() {
$('span:not(#t1 span, #t3 span)').css('background-color','red');
});