title: Bootstrap dropdown menu not working in mobile view
body: <p>I want that if I change to mobile view, the menu items will collapse and when I click it, then it shows the menu in dropdown. It seems this code does not work, what's wrong?</p>
  <p>I want to click this icon and show menu item in dropdown. Check this image
  <a href="https://i.stack.imgur.com/yaInj.png" rel="nofollow noreferrer">Mobile View</a></p>
  <p>This is how it looks like in desktop view <a href="https://i.stack.imgur.com/Qx1LT.png" rel="nofollow noreferrer">Desktop View</a></p>
  <p>in HTML:</p>
  <pre><code>&lt;nav class=&quot;navbar navbar-expand-md navbar-dark bg-dark&quot;&gt;
  &lt;div class=&quot;container-fluid&quot;&gt;
    &lt;a class=&quot;navbar-brand&quot; href=&quot;#&quot;&gt;Admin Panel&lt;/a&gt;
    &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot; data-bs-target=&quot;#navbarSupportedContent&quot;&gt;
      &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;
    &lt;/button&gt;
    &lt;div class=&quot;collapse navbar-collapse justify-content-end mr-5&quot; id=&quot;navbarSupportedContent&quot;&gt;
      &lt;ul class=&quot;navbar-nav ml-auto&quot;&gt;
        &lt;div class=&quot;btn-group m-1&quot;&gt;
          &lt;li class=&quot;nav-item&quot;&gt;
            &lt;a class=&quot;nav-link btn btn-success active m-1&quot; aria-current=&quot;page&quot; href=&quot;home.php&quot;&gt;View Event&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class=&quot;nav-item&quot;&gt;
            &lt;a class=&quot;nav-link btn btn-primary m-1&quot; href=&quot;add_event.php&quot;&gt;Add Event&lt;/a&gt;
          &lt;/li&gt;
          &lt;li class=&quot;nav-item dropdown&quot;&gt;
            &lt;div class=&quot;btn-group m-1&quot;&gt;
              &lt;button type=&quot;button&quot; class=&quot;btn btn-primary dropdown-toggle&quot; id=&quot;navbarDropdown&quot; data-toggle=&quot;dropdown&quot;&gt;
                User
              &lt;/button&gt;
              &lt;div class=&quot;dropdown-menu&quot; aria-labelledby=&quot;navbarDropdown&quot;&gt;
                &lt;a class=&quot;dropdown-item&quot; href=&quot;userFeedback.php&quot;&gt;Feedback&lt;/a&gt;
                &lt;a class=&quot;dropdown-item&quot; href=&quot;userProblem.php&quot;&gt;Issues&lt;/a&gt;
                &lt;div class=&quot;dropdown-divider&quot;&gt;&lt;/div&gt;
                &lt;a class=&quot;dropdown-item&quot; onclick=&quot;logoutChecker()&quot; href=&quot;index.php&quot;&gt;Logout&lt;/a&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/li&gt;
        &lt;/div&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
    
  <p>then the script:</p>
  <pre><code>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js&quot;&gt; 
  &lt;/script&gt;
  &lt;script src=&quot;https://unpkg.com/sweetalert/dist/sweetalert.min.js&quot;&gt;&lt;/script&gt;
  </code></pre>