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