<script> window.location = <Path / URL> </script>
<script> window.location = "https://www.geeksforgeeks.org/" </script>
Below is the step by step implementation:
Step 1: Create a file named index.html. Add a heading and two buttons to it. One button forcefully loads a page with a live URL and the other button loads a local HTML page. In the <script> tag we have two functions, one loads gfg home page, and the second loads a local HTML page using window.location property.