[jQuery] Appending Text based on class
I'm using a vertical menu, and I'm trying to put an arrow (〉) to
the right of the menu being hovered, but not the the 3rd level (final)
of the menu. The following code works (but with errors), and it still
adds the arrow on level 3, which I do not want. Any ideas?
error:
g has no properties
handleHover(Object type=mouseout target=a currentTarget=a
eventPhase=2)jquery.js (line 11)
e(Object type=mouseout target=a currentTarget=a eventPhase=2)jquery.js
(line 11)
e()jquery.js (line 11)
[Break on this error] eval(function(p,a,c,k,e,r){e=function(c)
{return(c<a?'':e(parseInt(c/a)))+((c=c%a...
jQuery:
$("ul.nav li a").hover(function() {
// on nav menu where class=arrow, add an arrow
$("span").remove(".showarrow");
$(this).append("<span class='showarrow'> 〉</span>");
});
html:
<ul class="nav">
<li><a href="#" class="showarrow">Level 1</a>
<ul>
<li>
<a href="#" class="showarrow">Level 2</a>
<ul>
<li><a href="#">Level 3</a></li>
</ul>
</li>
</ul>
</li>
</ul>