JSFiddle - React, Tailwind, and code Playground

HTML

<a href="#">click me</a>
<input type="text">

JavaScript

$("a").click(function() {
  var path = window.location.href;
  $("input").val(path);
});