JSFiddle - React, Tailwind, and code Playground
HTML
<label>
End URL<input type='text' onInput='modURL()' id='append'>
<label>
JavaScript
let url = location.href;
localStorage.setItem("url",url);
function modURL() {
if (typeof (history.pushState) != "undefined") {
//get the url
let newURL = localStorage.getItem("url")+'/?q='+document.getElementById('append').value;
let title = document.getElementById('append').value;
let obj = { Title: title, Url: newURL };
console.log("url ", newURL);
history.pushState(obj, obj.Title, obj.Url);
} else {
alert("Browser does not support HTML5.");
}
}