jQuery动态追加去掉样式

Posted 爱踢两键

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jQuery动态追加去掉样式相关的知识,希望对你有一定的参考价值。

<script type="text/javascript">
$(function(){
     $("h2").click(function(){
          $(this).addClass("style2 style3");
});
$("h2").mouseout(function(){
     $(this).removeClass("style1 style2");
   });
});
</script>

以上是关于jQuery动态追加去掉样式的主要内容,如果未能解决你的问题,请参考以下文章