jQuery(function($){ // toggleBtn var toggleBtn = document.getElementById('toggle-btn'); toggleBtn.addEventListener('click' , show); function show(){ var sideBar = document.getElementById('side-bar'); sideBar.classList.toggle('active'); } });