I'm remaking my website and want to do everything from scratch (no bootstrap, foundation, etc). Right now I'm making the navbar and I'm trying to get it to toggle slide in and out on click. For some reason click events aren't working and I'm not sure what I did wrong. I made a rough example in codepen here
HTML
<script src="jquery-3.4.1.min.js"></script>
<div class="box"></div>
CSS
.box {
transform: translateX(0);
width: 100px;
height: 100px;
background-color: red;
transition: transform 250ms;
}
.slide {
transform: translateX(250px);
}
JS
$(function() {
$('.box').on('click', function(slideToggle) {
$(this).toggleClass('slide');
});
});
Uncaught ReferenceError: $ is not defined