how to change current url in javascript code example
Example 1: js change url
window.location.href = "www.google.com";
Example 2: window replace url
location.replace("url");
Example 3: javascript change url without reload
window.history.pushState('', 'New Page Title', '/new-url.php');
Example 4: javascript change url
history.pushState({}, null, newUrl);