If you're looking for a neat demonstration of a JavaScript sidebar, I've put together a simple working example for you. Feel free to jazz it up with some cool CSS effects like animations and better styling on the list items. Hopefully this will be helpful!
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sidebar demo</title>
<style>
#sidebar {
position: fixed;
padding: 0px;
height: 100%;
background: orange;
left: -200px;
width: 200px;
}
#sidebar.active {
left: 0px;
}
#sidebar ul li {
padding: 15px 10px;
list-style: none;
}
.hamburger-btn {
position: absolute;
left: 230px;
top: 20px;
}
.hamburger-btn span {
margin: 5px 0px;
height: 5px;
width: 30px;
display: block;
background: black;
}
</style>
</head>
<body>
<div id="sidebar" class="active">
<div class="hamburger-btn" onclick="togglesidebar()">
<span></span>
<span></span>
<span></span>
</div>
<ul>
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>
<div id="content">
</div>
<script>
function togglesidebar() {
document.getElementById("sidebar").classList.toggle("active");
}
</script>
</body>
</html>