JSFiddle - React, Tailwind, and code Playground

HTML

<p><a href="index.php">Target Link</a></p>
<p><a href="contact.php">Another Link</a></p>
<p><button>Yay clicky!</button></p>

CSS

.make-me-green {
    color: green;
    font-weight: bold;
}

JavaScript

var url = "www.mysite.com/whatever/index.php";

//important bit
var target = $('a[href="'+url.split('/').pop()+'"]');

//this bit just proves the selector works
$('button').on('click', function() {
    target.toggleClass('make-me-green');
});