Materialize CSS collapsible component error

I have two collapsible component inside this page.

Why is the second one not working??

Hello,

It’s because you initialized only the first collapsible, not all:

// This selects the first element with the specified class
document.querySelector('.collapsible.expandable')

// This selects all elements that match:
document.querySelectorAll('.collapsible.expandable');
1 Like

oh wow. Thank you!

I assume in my app.js file I should check all the methods then!

1 Like