Skip to content
Advertisement

Bootstrap 5: Error when showing dropdown via JavaScript

I’m trying to show a dropdown via JS. Unfortunately it seems like there’s a bug in Bootstrap 5. In this example code, showing the modal works, but showing the dropdown throws an exception: Uncaught TypeError: Cannot read property 'classList' of undefined at _e.show (dropdown.js:140)

JavaScript

Am I doing something wrong or is this a bug?

Thanks in advance.

Advertisement

Answer

I got it working without using a button:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement