JSFiddle - React, Tailwind, and code Playground

HTML

<form action="" onsubmit="setURL(this)">
    <input type="text" id="urlVal" />
    <input type="submit" value="submit" />
</form>

JavaScript

function setURL(form) {
        form.action="dogs/"+form.urlVal.value;
        console.log(form.action);
        event.preventDefault();
    }