JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
<script src="script.js" type="text/javascript" ></script>
<link rel="stylesheet" href="style.css">
<title>alphaEncryption's Website!</title>
</head>
<body>
<h1>Welcome to the website!</h1>
<h2>have a look around!</h2>
<button id='home' onclick='homepage()'>Home</button>
<button id='contact' onclick='contactpage()'>Contact</button>
<button id='about' onclick='aboutpage()'>About</button>
<div id='pageContainer'>
<p id='page'>This is the main page of the site!</p>
</div>
</body>
</html>
JavaScript
var page = document.getElementById('pageContainer');
function homepage() {
page.innerHTML = '<p>This is the main page of the site!</p>';
}
function contactpage() {
page.innerHTML = '<p>This is the contact page of the site!</p>';
}
function aboutpage() {
page.innerHTML = '<p>This is the about page of the site!</p>';
}