jquery 去除 ul 下 <a>中所有 class?

jquery 去除 ul 下 <a>中所有 class?,第1张

<script>
$(function(){
$('navBoxer a')mouseenter(function(){
        $('navBoxer a')removeClass('hover');
$(this)addClass('hover');
});
});
</script>

需要先引入jq库

$(document)ready(function(){
$("#gly_head #gly_ban tow")mouseover(function(){
$(this)removeClass("tow")
$(thisaddClass("one");
})mouseout(function(){
$(this)removeClass("one");
$(this)addClass("two");
});
});

<div>
  <a class="a b c d e f g">s</a>
  <a class="a b">d</a>
  <a class="a b">d</a>
</div>

js

$('div a')removeClass('a b');
//将所有的a标签移除样式a 和样式 b


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/yw/10310578.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-07
下一篇 2023-05-07

发表评论

登录后才能评论

评论列表(0条)

保存