I am using tailwind CSS. I want my modal popup to automatically popup when a user lands on the page, rather than wait for the user to click the button.
This is my jQuery click method:
$("#mybutton").click();
$(".mybutton").trigger('click');
This is the modal button and the modal.
<button data-modal-target="crud-modal" id="mybutton" data-modal-toggle="crud-modal"
class="mybutton " type="button">
Toggle modal
</button>
<div id="crud-modal" tabindex="-1" aria-hidden="true"
class="hidden overflow-y-auto overflow-x-hidden fixed">
<div class="relative p-4 w-full max-w-md max-h-full">
<!-- Modal content -->
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
<!-- Modal header -->
<div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">
Create New Product
</h3>
<button type="button">
<span class="sr-only">Close modal</span>
</button>
</div>
</div>
</div>
</div>