JSFiddle - React, Tailwind, and code Playground
by chiragvidani
HTML
<ul id="changeColr">
<li>100</li>
<li>200</li>
<li>300</li>
</ul>
<button>Click Me</button>
JavaScript
$(document).ready(
function()
{
$('button').click(
function()
{ $('#changeColr li').each(function(){
if( $(this).html() == '200')
{
$(this).css('color', 'red');
}
else
{
$(this).css('color', '')
}
});
}
); //end click
}
); //end ready