How can we destroy active accordion with all the content is have in it.
I started with this function
function DesctroyThisAccordion() {
var active = jQuery("#accordion").accordion('option', 'active');
jQuery("#accordion").accordion('option', 'active').remove('h3');
jQuery("#accordion").accordion('option', 'active').remove('div');
}
I am using jQuery UI plugin for accordion
I am trying to find the active accordion and delete its h3 and div content.
i works if i select the last in accordion
//jQuery("h3[class^='Title']:last").remove('h3');
//jQuery("div[class^='ui-accordion-content']:last").remove('div');
But i want it for active accordion
any help would be greatly appreciated.
Since i didn't find any help on this question. I found solution, which may be helpful for any who are in same need.
jQuery("h3[class^='Title'][aria-selected='true']").remove('h3');
jQuery("div[class^='ui-accordion-content'][style^='display: block;']").remove('div');