Get or Create Instance
Static method which allows you to get the dropdown instance associated with a DOM element, or create a new one in case it wasn’t initialized.
const myDropdown = tailwind.Dropdown.getOrCreateInstance(document.querySelector("#myDropdown"));
Get Instance
Static method which allows you to get the dropdown instance associated with a DOM element.
const myDropdown = tailwind.Dropdown.getInstance(document.querySelector("#myDropdown"));
Hide
Manually hides a dropdown. Returns to the caller before the dropdown has actually been hidden (i.e. before the hidden.tw.dropdown event occurs).
Show
Manually opens a dropdown. Returns to the caller before the dropdown has actually been shown (i.e. before the shown.tw.dropdown event occurs).
Toggle
Manually toggles a dropdown. Returns to the caller before the dropdown has actually been shown or hidden (i.e. before the shown.tw.dropdown or hidden.tw.dropdown event occurs).