Skip to content

Instantly share code, notes, and snippets.

@esr360
Created December 22, 2017 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esr360/c4ca85b3010dc322def28907b7c7a3f6 to your computer and use it in GitHub Desktop.
Save esr360/c4ca85b3010dc322def28907b7c7a3f6 to your computer and use it in GitHub Desktop.
const MODULE = 'accordion';
document.querySelectorAll(`.${MODULE}`).forEach(accordion => {
const panels = accordion.querySelectorAll(`.${MODULE}__panel`);
panels.forEach(panel => {
const TITLE = panel.querySelector(`.${MODULE}__title`);
const CONTENT = panel.querySelector(`.${MODULE}__content`);
...
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment