How are webpages linked? : <p>I'm having trouble figuring out how two pages are linked. For example if I have the following code:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;button onclick='myfunction()'&gt;Click me&lt;/button&gt;
&lt;body&gt;

&lt;script&gt;
function myfunction() {
//some code to take user to the next page
}
&lt;/script&gt;

&lt;style&gt;
some style code
&lt;/style&gt;
</code></pre>

<p>How is the code for the second html file called?</p>

<p>Do all the contents of all webpages reside in one big html file where elements are hidden depending on the what they've clicked on? For example - the <code>div</code>'s shown on the 'home page' would be shown, while other ones hidden, if you click on a 'home' tab; essentially reformatting the elements on a page for a given file.</p>
