jQuery选择器

时间:2010-07-14 05:00:50

标签: jquery html jquery-selectors

所以我在获取某个div来显示onclick时遇到了一些麻烦。任何人?

HTML

<div style="float:left;width:40px;">
<span class="productControl" style="position:relative;">
    <div class="productMenuHolder" style="display:none;">
    <ul class="productMenuList">
        <li class="productMenuItem">Add to Collection</li>
        <li class="productMenuItem">Share</li>
    </ul>
    </div>
</span>
</div>

的jQuery

$("span.productControl").click(function(){
    $(this).next().show();
});

productMenuHolder似乎没有出现!

1 个答案:

答案 0 :(得分:3)

$(this).find('.productMenuHolder').show()

我建议你仔细看看标记。