Remove the hash # from url (without redirect)
location.hash = "?userid=" + document.getElementById("userid").innerHTML;
location.href.replace('#', '');
EDIT: Answer = window.history.pushState("", "", window.location.href + "?userid=" + document.getElementById("userid").innerHTML);