JSFiddle - React, Tailwind, and code Playground

by paska

HTML

<input type="text" id="txt" />
<a id="link" href="http://www.example.com/">Link</a>

JavaScript

var link = document.getElementById("link"),
    txt = document.getElementById("txt"),
    baseUrl = link.href;

txt.onchange = function() {
    link.href = baseUrl + "?param=" + this.value;
};