JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" name="input" id="input" value="123">
<input type="submit" id="submit" value="Отправить">

JavaScript

$('#submit').click(function(){
    var inputVal = $('#input').val();
    var url = document.location.href;
    
    url.replace(/\/$/,'') + '/';
    url += inputVal + '/';
    
    alert(url);
    //редирект
    //document.location.href = url;
});