How to focus the Accordion top header when we click on that

Viewed 1762

JS FIDDLE OF MY ACCORDION

I am trying to focus on header or first div which is inside of accordion but it is not working.

In the js fiddle by default html is active and it consist of 11 questions in it. And now PHP by default it is collapsed and when we click on it it will open and HTML will collapse.

My problem is when i click on PHP it is showing the last question in my case it is showing 11th question of PHP, Actually it should show the first quuestion of PHP how can i achieve it..?

Please see the js fiddle which i have shared.

i have tried with 3 different ways but none are working:

$("#panelForPHP").click(function(){     $("#accordionPHP").focus(); });
$("#panelForPHP").click(function(){     $("#collapsePHP1").focus(); });
$("#panelForPHP").click(function(){     $("#panelForPHP").focus(); });
2 Answers
Related