css selectors - Wrap inner anchor tags of only the parent UL with jquery -


i'm having trouble finding right selector nested uls. have following code:

<ul class="menu">   <li><a href="">top link 1</a></li>   <ul class="menu">     <li><a href="">sub link 1</a></li>     <li><a href="">sub link 2</a></li>     <li><a href="">sub link 3/a></li>   </ul></li>   <li><a href="">top link 2</a></li>   <li><a href="">top link 3</a></li> </ul> 

this menu system generated our cms i'm trying use jquery wrap inner "top link" anchors <strong><span> add more styling.

i've tried multiple versions of:

$('ul.menu:first li a').wrapinner('<strong><span>'); 

but havent' had luck. seems wrap anchors inside of ul. i'm sure there parent/child selector need use i'm not sure one.

$('ul.menu:first>li a').wrapinner('<strong><span>');

practice: fiddle


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -