'Dropdown and collapse not going back up after being clicked

I'm learning boostrap 5 and everything has been okay. Until I reached the drop-down and collapse menus. I click it and it pops up. But then then when I reclick it, the menu doesn't go back up, like it doesn't disappear again. It's funny because I've just copied and pasted the code given at the docs of bootstrap and yet they're not behaving how they should. I am not using the cdn, but I downloaded the source files because I am using it with sass. I've linked the bootstrap.js and the bootstrap.bundle.js files in the dist from the bootstrap files. And the css is linked too.

Is it my laptop? Is it probably my browser? Or probably it works with the cdn and not the download source files?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source