Bootstrap 3 Open Drop Down on page load with Javascript

前端 未结 2 1619
鱼传尺愫
鱼传尺愫 2021-01-15 18:02

I can\'t seem to open this dropdown menu on page load. Can anyone help? Documentation on Bootrap 3 is here: http://getbootstrap.com/javascript/#dropdowns

I tried thi

相关标签:
2条回答
  • 2021-01-15 18:54

    try this :

    $(function () {
      $('.dropdown-menu').dropdown('toggle');
    });
    
    0 讨论(0)
  • 2021-01-15 19:05

    Try this..

    $(function () {
        $('[data-toggle="dropdown"]').dropdown('toggle');
    });
    

    Or you can use the button id like:

     $('#dLabel').dropdown('toggle');
    
    0 讨论(0)
提交回复
热议问题