Accordion won't target proper header element

Hello dear friends.

I was trying to set an accordion in Wordpress left menu and after a little struggle find out how to make accordion scripts work… but…

The heading is set to the element “a” and that result in all links trigering the accordion when it should be just the first one (the link that works as heading)

Here is the code…

jQuery(document).ready(function($) {
	$( "#accordion" ).accordion({
		collapsible: true,
		header: "a",
                heightStyle: "content",
                collapsible: true,
                active: false

As you can see the "header: “a”, supose to target the first “a” element but is not working for me. I even try different CSS combinations with :first-child, :first-of-type

URL is

Does anyone know how to target that specific menu heading? Any help is very appreciated.


Ok … got it working after trial an error.

Since the “a” headings are self linked with href=“#” I just target

header: 'a[href="#"]'

Thanks Sitepoint forum for support and post my question anyway.