我试图在点击时隐藏元素的父级,但我无法让它工作。我已经尝试了所有我在谷歌上找到的所有东西,并将其指向一个特定的元素,但无法让它工作......帮助!
HTML
<div class='delete'>
<div class='deletePopup'>
<p>Are you sure you want to delete this task?</p>
<div class="notDelete">NO</div>
<div class="yesDelete" id="deletetask1">YES</div>
</div>
</div>
JS
$(".notDelete").bind( "click", function(){
$(this).parent('div').hide();
});