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