title: Bootstrap V5 manually call a modal myModal.show() not working (vanilla javascript)
body: <p>whats the correct way to manually call a modal in bootstrap 5?</p>
  <p>i want to show the modal when page is open. i tried this:</p>
  <p>my modal</p>
  <pre><code>&lt;div class=&quot;modal fade&quot; id=&quot;myModal&quot; tabindex=&quot;-1&quot; aria-labelledby=&quot;exampleModalLabel&quot; aria-hidden=&quot;true&quot;&gt;
    &lt;div class=&quot;modal-dialog&quot;&gt;
      &lt;div class=&quot;modal-content&quot;&gt;
          ... 
          ... 
          ... 
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>my script is</p>
  <pre><code>var myModal = document.getElementById('myModal');
  document.onreadystatechange = function() {
     
      myModal.show();
  }
  </code></pre>
  <p>but got this error in console log:</p>
  <pre><code> myModal.show is not a function
      at HTMLDocument.document.onreadystatechange
  </code></pre>