首页javascriptcss_attributejQuery Style - 如何将元素的hover css属性分配给其他一些元素

jQuery Style - 如何将元素的hover css属性分配给其他一些元素

我们想知道如何将元素的hover css属性分配给其他一些元素。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    $(function() {
       $('.abcClass').hover( function(){
          $(this).css('color', 'red');
       },
       function(){
          $(this).css('color', 'green');
       });
    });
});
</script>
</head>
<body>
  <a href="#" class="abcClass">Link To Something</a>
</body>
</html>