JSFiddle - React, Tailwind, and code Playground

HTML

<span id="layer6">
<span class="drag col">  Some text</span>
<span class="drag col">  More text</span>
<span class="drag col">  </span>
<span class="drag col">  I also have text</span>
</span>

CSS

.col {
    display:block;
    background:red;
    height:50px;
    margin:5px;
}

.foo {
    background:yellow;
}

JavaScript

$("span.col").each(function(){
    if (!$(this).text().trim().length) {
        $(this).addClass("foo");
    }
});