title: Opening Bootstrap Alert programmatically
body: <p>I'm trying to dynamically show a bootstrap alert <a href="https://getbootstrap.com/docs/4.3/components/alerts/" rel="nofollow noreferrer">https://getbootstrap.com/docs/4.3/components/alerts/</a>
  that displays a message to accept using cookies once a user clicks the OK button, the alert message should disappear and not show to that user again during that session. </p>
  
  <p>Unfortunately, I can't find a documentation on bootstrap site that allows for programmatic opening of a bootstrap alert. Therefore every-time the website is refreshed, the alert pops up again. </p>
  
  <pre><code> &lt;div class="alert fade show cookie-alert" role="alert" data-dismiss="alert"&gt;
              &lt;div class="container"&gt;
                  This website stores cookies. These cookies are used to collect information about how you interact with our website, we use this information to improve and customize your browsing experience. Read our &lt;a target="_blank" href="http://assets.investnow.ng/InvestNow_TC.pdf" style="color:gray;font-weight:bold"&gt;terms and conditions&lt;/a&gt; to learn more.
                  &lt;button type="button" class="btn btn-danger btn-sm pull-right cookie-btn okbtn" data-dismiss="alert" aria-label="Close"&gt;OK&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>