title: How to initialize toasts with JavaScript in Bootstrap 5?
body: <p>I can't initialize Bootstrap 5 Toasts.</p>
  <p>The button to initialize the toast:</p>
  <pre><code>&lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot; id=&quot;toastbtn&quot;&gt;Initialize toast&lt;/button&gt;
  </code></pre>
  <p>My JavaScript:</p>
  <pre><code>document.getElementById(&quot;toastbtn&quot;).onclick = function() {
          var toastElList = [].slice.call(document.querySelectorAll('.toast'))
          var toastList = toastElList.map(function(toastEl) {
            return new bootstrap.Toast(toastEl, option)
          })
        };
  </code></pre>
  <p>JSfiddle: <a href="https://jsfiddle.net/5e1t3scp/" rel="noreferrer">https://jsfiddle.net/5e1t3scp/</a></p>
  <p>And <a href="https://v5.getbootstrap.com/docs/5.0/components/toasts/#usage" rel="noreferrer">here's the documentation</a>.</p>
  <p>The JavaScript has been taken from Bootstrap's website. I tried many times but couldn't initialize it. What am I doing wrong? Thanks in advance!</p>