1class CodePenAccordion { 2 constructor(element){ 3 this.accordion = element; 4 this.toggles = this.accordion.querySelectorAll('.accordion__toggle'); 5 this.panels = this.accordion.querySelectorAll('.accordion__panel') 6 } 7 init() { 8 this.toggles.forEach(toggle => { 9 toggle.addEventListener('click', (e) => { 10 this.panels.forEach(panel => { 11 if (panel !== e.target.parentNode) { 12 panel.classList.remove('active') 13 } 14 }) 15 e.target.parentNode.classList.toggle('active') 16 }) 17 }) 18 } 19} 20 21document.querySelectorAll('.accordion').forEach(accordion => { 22 const codePenAccordion = new CodePenAccordion(accordion); 23 codePenAccordion.init(); 24})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.