JSFiddle - React, Tailwind, and code Playground

by boraganesh

HTML

<a href="www.xyz.com/abc">tes1t</a>

JavaScript

$('a').each(function() {
    
    //var link = this.href;
  //this.href += link.indexOf('/') != -1 ? link : link+"/test";
    url =  $(this).href;
    alert(url);
  url = url.lastIndexOf('/') !== (url.length -1) ? url += '/' : url;
  this.href  = url;
});