What am I doing wrong for this submenu to not appear?

Posted by Doug on Stack Overflow See other posts from Stack Overflow or by Doug
Published on 2010-04-23T02:54:44Z Indexed on 2010/04/23 3:03 UTC
Read the original article Hit count: 230

Filed under:

I'm new to jQuery, so please bear with me. I'm trying to make my submenu appear on hover. The second set of <ul> is for submenu.

$(document).ready(function(){
    $('ul.menu.li').hover(
        function() { $('ul', this).css('display', 'block'); },
        function() { $('ul', this).css('display', 'none'); });
});

<ul id="menu">
<li><a href="#">Item 1</a><li>
<ul>
<li>Hi</li>
</ul>
<li><a href="#">Item 2</a></li>
</ul>

© Stack Overflow or respective owner

Related posts about jQuery