html go to another page code example

Example 1: html redirect

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Meta Tag</title>
      <meta http-equiv = "refresh" content = "2; url = https://www.tutorialspoint.com" />
   </head>
   <body>
      <p>Hello HTML5!</p>
   </body>
</html>

Example 2: a href to other site

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

Example 3: linking external pages html

<a href="https://www.w3schools.com/html/">Visit our HTML tutorial</a>

Example 4: html redirect to another page

<script>
  function foo() {
  	window.location.href = url
  }
</script>

Tags:

Html Example