I use modal from https://tailwind-elements.com/docs/standard/components/modal/
in laravel/alpinejs app and looking at these examples I see that modal is opened/closed with
data-bs-target link .
How can I open/close this modal with javascript?
I need to assign on Save button javascript function and run axios request.
On succes I need to hide this modal
click on whatever opens the modal? I mean… basically if you dont know how the framework is opening and closing the modal, the simplest answer is to mimic the user’s interaction and let the code sort itself out.
Why not use the html5 dialog element?
It is now supported in most of the latest browser versions.
Once setup it is opened with .showModal() method
and closed with .close() method
The dialog element can be appended to any other element including the body element.