Hello, there is a bootstrap dropdow. With a success ajax request, you need to open it (i.e., without clicking on something). How to implement it? I tried to assign the class open, the dropdown opens but does not close when clicking on the site.

<span class="dropdown search-dropdown"> <ul class="dropdown-menu" id="dropd-search" style="margin: 2px -107px;"> <form> <div class="search-users"> <div class="search-users-block"> </div> </div> <div class="search-link hover" onclick="$('#search-icon').click();"> {gosearch} <img src="/incl/img/icons/right_icon.svg" id="right-icon"> </div> </form> </ul> </span> 
  • Make a demo on jsfiddle, so it will be easier to understand the problem and help - Andrew Evt

1 answer 1

You can add a class to the element to open the list.

  success: function() { $( '.dropdown' ).addClass('open'); //Вместо "open" подставьте нужный класс. }