index problem

index problem

Hi.

I am trying to wrap <a> tags around text in <li> elements. How can I get the index of the <li> in the <ul>?

I tried something like this:
$('.tabbed-list li').wrapInner('<a></a>');

That works fine. However, I want to do something like this:

$(this).wrapInner('<a href="#' + $(this).index() + '"></a>');

Would be great if you could help.

Regards
Simon