Changing focus in an A-Z index

Changing focus in an A-Z index

Hi,

I'm working on this A-Z example with scrolling:


It works fine. Now I just need to achieve that each time I click on one of the alphabets, the focus changes to the targeted h1 alphabet.

To achieve this I added the following two lines to the code:

  1. target.addClass('focus');
  2. target.focus();

But it still doesn't change the focus to the targeted alphabet.

How can I change the focus after each click?

Thanks