I am using the jQuery and HTML shown on this fiddle and for the life of me am not able to manually fire individual tabs.
$("h3").toggleClass("ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom").find(".ui-icon").toggleClass("ui-icon-triangle-1-e ui-icon-triangle-1-s").end().next().slideToggle();
The above jQuery will toggle all of the elements, but if I reference an individual in this manner:
$(“#ToggleHeader”).etc
it will not work.
I’d love some help and hopefully an explanation why this isn’t working for me.
The solution you tried doesn’t work because the selector
$("h3")matches everyh3on the page, so the operations that follow are applied to all of them. The second solution you tried didn’t work because theh3elements in your html code do not have any ids.Add an id to each element, and then select the header using the id selector
$("#ToggleHeader")etc..