JSFiddle - React, Tailwind, and code Playground

HTML

<div class="menu_items">
<ul class="ul_items" id="navigation">
    <li><a href="index.php">1</a></li>
    <li><a href="index.php?pg=2">2</a></li>
    <li><a href="index.php?pg=3">3</a></li>
    <li><a href="index.php?pg=4">4</a></li>
    <li><a href="index.php?pg=5">5</a></li>             
</ul>
</div>

CSS

ul li a.active { border: 1px solid #000; }

JavaScript

//var tempURL = window.location.href; //your case

    //example
    var tempURL = "http://www.websiteurl.com/index.php?pg=3"
    var urlMatch = tempURL.split('.com')[1].split('/')[1];
    var hrefVal = $("#navigation a:eq(1)").attr('href');
$("#navigation").find("a[href='"+hrefVal+"']").each(function() {
    $(this).html('Current Page');
});