Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap dropdown not getting "open" class

I am trying to make a dropdown button using bootstrap like this:

<div class="btn-group">
<a href="#" type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"> dropdown </a>

                <ul class="dropdown-menu" role="menu">
                    <li><a href="#">Action</a></li>
                    <li><a href="#">Another action</a></li>
                </ul>
</div>

bootstrap inserts "open" class for parent div on clicking the button to show dropdown menu. In my case it doesn't insert "open" class. I tried replacing "btn-group" with "dropdown" but no benefit. It is verified that bootstrap.min.js includes in sources. Many thanks

like image 323
Muhammad Ahmar Khan Avatar asked Feb 13 '23 09:02

Muhammad Ahmar Khan


1 Answers

in bootstrap 4 it is show class instead of open

<div class="btn-group">
<a href="#" type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"> dropdown </a>
 <ul class="dropdown-menu show" role="menu">
   <li><a href="#">Action</a></li>
   <li><a href="#">Another action</a></li>
 </ul>
</div>
like image 200
kerbrose Avatar answered Feb 16 '23 01:02

kerbrose