jQuery 动态添加、删除css样式

1.addClass 

css中:

<style type="text/css">
       .chColor {background: #267cb7;color:white;
     }
   </style>

js中:

$("#nm_p").addClass("chColor"); // 追加样式

$("#nm_p").removeClass("chColor"); //移除

2.css

  $("#61dh a").hover(
function
(){
     $(this).css('color','#999');
  },
    function(){
     $(this).css('color','#123456');
});
原文地址:https://www.cnblogs.com/weimingxin/p/8098025.html