<!DOCTYPE html>

<html>

<head>

<title>How to build a website</title>

<link rel=”stylesheet” href=”style.css”>

</head>

<body>

<div id=”navigation”>

<div id=”navigation-inside”>

<ul>

<li><a href=”index.html”>Home</a></li>

<li><a href=”html.html”>HTML</a></li>

<li><a href=”css.html”>CSS</a></li>

<li><a href=”javascript.html” class=”active”>JavaScript</a></li>

</ul>

</div>

</div>

<div id=”quick-menu”>

<h3>Quick Links</h3>

<ul>

<li><a href=”#for-loop”>for loop</a></li>

</ul>

</div>

<div id=”header”>

<img src=”img/header-image.jpg” alt=”Header Image”>

<div id=”profile”>

<div id=”profile-image”>

<img src=”img/profile-icon.png” alt=”Profile icon”>

</div>

<h2>by<br>Kenny Wood</h2>

</div>

</div>

<div id=”introduction”>

<h1>JavaScript</h1>

<p>Welcome to the dedicated JavaScript section. This page contains all of the JavaScript elements that I have understood and used so far on my journey into web design.</p>

</div>

<div id=”for-loop” class=”section”>

<h1>for loop<h1>

<p>for loops are great for getting a statement to run a certain number of times. In the below example, clicking the button will start a for loop which will run exactly 10 times and log to the console each time</p>

<div class=”example”>

<script>

function runForLoop() {

for(var i = 1; i <= 10; i++) {

console.log(”This loop has run “ + i + ” times”);

}

}

</script>

<input type=”button” class=”run-javascript” value=”Run for loop” onclick=”runForLoop()” />

</div>

 

<input class=”code-show-button” type=”button” onClick=”showCode(‘for-loop’)” value=”Show code” />

</div>

<script src=”main.js”></script>

</body>

</html>

Next steps

Just like with the HTML and CSS sections, it is now up to you to go through the JavaScript section in this book and add new sections for each example of an area of JavaScript that you encounter. Some examples that I can suggest for this would be:

Conclusion

Well there we have it, you’ve just finished creating your first website. At the start of this book, we introduced how websites work, and here we are at the end and you have just finished creating your own website from scratch. Your resilience and determination will serve you well as a web designer – these traits are an essential part of being successful in the ever-evolving field. Congratulations again for sticking it out and getting to the end of the book. However, now that we have created our website, there is just one tiny thing left to do. Get it online. In the final chapter of this book, we will take your website from a folder on your computer to having its own URL, accessible from all over the world.

Possible further improvements

Just one quick note before we leave this section and get your website online. While this website is built, like everything in web design, nothing is ever truly finished as we can always improve our website further. If you want to take your website to the next level and use some more advanced techniques, then here is a small list of possible enhancements that you could make to the website: