<div class="content">
<div class="div1" style="background: #afe986">aaaaa</div>
<div class="div2" style="background: #e979c0">bbbbb</div></div><div class="content">
<div class="div3" style="background: #a5dbe9">ccccc</div>
<div class="div4" style="background: #e9e514">ddddd</div></div><script src="https://code.jquery.com/jquery-3.1.1.min.js">
</script><script>
$('.content').hover(function () { var myhtml = $(this).children();
myhtml[1].hide();
});</script>Console過myhtml的內容了,輸出沒問題的。難道this訪問子節點后調用方法不能這樣?求解,謝謝
使用jq中的this訪問子節點后,一旦調用方法就報錯
蠱毒傳說
2018-09-12 13:27:12