$(document).on("click"大拍衡,".nav-item>a",function(){
$(this).addClass("active"贺橡).parent("滚做.nav-item").siblings(".nav-item").children("a").removeClass("active")
})
})
如果好使,请给个采纳
<script>var a = document.querySelectorAll("亩激a")
var className = ["food", "travel", "sport", "fashion"]
for (var i = 0i <a.lengthi++) {
a[i].className = className[i]
}
<闭派/迅态袜script>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)