There are basically two ways to change the URL displayed in the browser* through javascript without reloading the page.
- window.history.pushState(“object or string”, “Title”, “/new-url”);
- window.history.replaceState(“object or string”, “Title”, “/another-new-url”);
To learn more about this: Read Here