I have been trying to make a responsive navigation bar to use as a template when when working on projects in the future. Ive followed a few tutorials and mashed together what ive learnt, now when trying to toggle a hamburger menu that i have created i cant seem to get it to toggle and can not figure out what i'm doing wrong. Still a newbie at this so if someone could point me in the righ direction that would be great.
Here is my html and javascript:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Navigation</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>
<body>
<nav class="nav-main">
<img class="logo" src="images/melogo.png" alt="logo">
<span class="nav-button"> </span>
<ul class="nav">
<li>
<a href="#" class="nav-item">Home</a>
</li>
<li>
<a href="#" class="nav-item">Images</a>
</li>
<li>
<a href="#" class="nav-item">Spots</a>
<div class="nav-content">
<div class="nav-sub">
<ul>
<li><a href="#" class="nav-item">Street spots</a></li>
<li><a href="#" class="nav-item">Skateparks</a></li>
</ul>
</div>
</div>
</li>
<li>
<a href="#" class="nav-item">About us</a>
</li>
</ul>
</nav>
<script>
$('span.nav-button').click(function {
$('.nav-main ul').toggle();
})
</script>
<div class="content">
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
</div>
<!-- page content -->
</body>
</html>