所有的
<li>
s与类“x”有一个跨度,我想将“x”类切换到特定的
<span>
对应于
<li>
我在上面徘徊,不是对他们所有人
我不能这么做:
$("div ul li").on("mouseenter mouseleave", function(){
$("span").toggleClass("x")
})
因为它可以切换所有
<跨度>
s公司
我想我应该用关键字
this
,但我不知道怎么做,假设,
$(this)."span"
,或
$($(this)."span")
. 我要知道怎么做