JSFiddle - React, Tailwind, and code Playground

HTML

<ol>
<li>
    <a href="http://www.google.com/">Google</a>
</li>
<li>
    <a...

CSS

li {background-color: red;}
li.long {background-color: green;}

JavaScript

$('li a').filter(function () {
    return $(this).attr('href').length > 40;
}).closest('li').addClass('long');