window.location change location code example Example: change window location javascript location.replace("https://www.w3schools.com");