jQuery选择器:显示onclick

jQuery选择器:显示onclick,jquery,html,jquery-selectors,Jquery,Html,Jquery Selectors,我在找一个特定的演员来表演onclick时遇到了点麻烦。有人要吗 HTML <div style="float:left;width:40px;"> <span class="productControl" style="position:relative;"> <div class="productMenuHolder" style="display:none;"> <ul class="productMenuList">

我在找一个特定的演员来表演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>
productMenuHolder似乎没有出现

$(this).find('.productMenuHolder').show()
我建议你仔细看一下标记


我建议你仔细看一下标记

您正在使用
$(函数(){…})以确保您的处理程序被绑定?另外,为什么span包含div?这将在以后引起问题。您是否正在使用
$(函数(){…})以确保您的处理程序被绑定?另外,为什么span包含div?以后会有问题的。谢谢你@meder。为什么。下一个不起作用?(我会接受你的回答,但stack会让我在9分钟内回答)下一个意思是下一个兄弟姐妹,而不是孩子。span拥有div.ah…愚蠢::用手敲打头部::作为后续,当有人单击ProductMenuHold div以外的任何位置时,我如何使弹出div隐藏?谢谢@meder。为什么。下一个不起作用?(我会接受你的回答,但stack会让我在9分钟内回答)下一个意思是下一个兄弟姐妹,而不是孩子。span拥有div.ah…愚蠢::用手敲打头部::作为跟进,当有人单击除ProductMenuHold div之外的任何位置时,我如何使弹出div隐藏?
$(this).find('.productMenuHolder').show()