JSFiddle - React, Tailwind, and code Playground

HTML

<ul>
  <li>5a</li>
  <li>5b</li>
  <li>5c</li>
  <li>5d</li>
  <li>6a</li>
  <li>6b</li>
  <li>6c</li>
  <li>6d</li>
</ul>

JavaScript

$("li").each(function(){
    var text = $(this).html();
    var number = parseInt(text, 10);
    switch(number){
        case 5:
            $(this).css( "backgroundColor", "yellow" );
            break;
        case 6:
            $(this).css( "backgroundColor", "green" );
            break;            
    }    
});