how to link multiple html pages code example

Example 1: a href code

<a href="link">Text</a>

Example 2: multiple pages in one html file

<html>
<head>
<script>
function show(shown, hidden) {
  document.getElementById(shown).style.display='block';
  document.getElementById(hidden).style.display='none';
  return false;
}
</script>
</head>
<body>

  <div id="Page1">
    Content of page 1
    <a href="#" onclick="return show('Page2','Page1');">Show page 2</a>
  </div>

  <div id="Page2" style="display:none">
    Content of page 2
    <a href="#" onclick="return show('Page1','Page2');">Show page 1</a>
  </div>

</body>
</html>

Example 3: html multi page website

<nav>
  <ul>
    <li><a href="#">Navigation</a></li>
    <li><a href="#">Menu</a></li>
    <li><a href="#">Links</a></li>
  </ul>
</nav>

Example 4: how to create multiple pages in html

<!-- Answer to: "how to create multiple pages in html" -->

<!DOCTYPE html>
<html>
<head>
	<link href="./style.css">
    <script type="text/javascript" src="./script.js"></script>
	<title></title>
</head>
<body>
	<a href="./new_page.html">Link to other pages</a> 
	...
</body>
</html>

Example 5: html add page to document

<nav>
  <ul>
    <li><a href="myPage.html">Main Page</a></li> <!-- Add a link to a website. -->
    <li><a href="myOtherPage.html">Other Page</a></li> <!-- Add a link to another website. -->
  </ul>
</nav>