how to link two html pages code example

Example 1: how do i link two pages in html

<button onclick="location.href='filename.html'">
</button>

Example 2: hyperlink html

<a href="url">link text</a>

Example 3: how to switch between html pages

function change_page(){
   // similar behavior as an HTTP redirect
   window.location.replace("test.html");
   //or
   // similar behavior as clicking on a link
   window.location.href = "test.html";
};

Example 4: a href to other site

<a href="https://examplesite.com" target="_blank" rel="noopener noreferrer">
  Example Link
</a>

Example 5: link to external site html

<a href="https://www.example.com">This is a link</a>

Tags:

Misc Example