JSFiddle - React, Tailwind, and code Playground

by kevinPHPkevin

HTML

<div class="sptests">
  <ul>
      <li id="sp_test" class=""><span>Test</span></li>
      <li id="sp_test2" class=""><span>Test 2</span></li>
      <li id="sp_test3" class=""><span>Test 3</span></li>
  </ul>
</div>

JavaScript

$("span").each(function() {
    if($(this).text() == "Test 2") {
        $(this).text('some example text');
    }
})