JSFiddle - React, Tailwind, and code Playground
HTML
<ul class="logoUl">
<li >Test 1</li>
<li >Test 2</li>
<li>Test 3</li>
<li >Test 4</li>
</ul>
JavaScript
var strString = "orange,blue,green,pink",
strArray = strString.split(',');
$("ul.logoUl > li").addClass(function (index) {
return strArray[index];
});
console.log($('ul li'));