当从其标记元素接收到事件时,我想使用类切换所有列表项上的checkedList
和selectedList
类,最后将带有类元素的相应范围内的文本放入带有类的 div 中。privListItem
a
privLabel
privLabel_textHere
<div class="privLabel_textHere"></div>
<div class="psSelectDD dn">
<ul class="psSelectUl">
<li class="privListItem checkedList selectedList">
<a href="/pp" class="psLink">
<span class="privLabel">PP</span>
</a>
</li>
<li class="privListItem">
<a href="/pf" class="psLink">
<span class="privLabel">PF</span>
</a>
</li>
<li class="privListItem">
<a href="/po" class="psLink">
<span class="privLabel">PO</span>
</a>
</li>
</ul>
</div>
这是下面的JS
$(".psSelectDD li").find("a").on("click", function(e) {
var $this = $(this);
e.preventDefault();
});