Skip to content

Instantly share code, notes, and snippets.

@DavidMellul
Created September 24, 2018 09:26
Show Gist options
  • Save DavidMellul/1a3fc192c227d772fe123eb0dda9ab5f to your computer and use it in GitHub Desktop.
Save DavidMellul/1a3fc192c227d772fe123eb0dda9ab5f to your computer and use it in GitHub Desktop.
const sidebar = document.getElementById('sidebar');
const button = document.getElementById('toggle');
button.addEventListener('click', _ => {
sidebar.classList.toggle('collapsed');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment