<script type="text/javascript" src="javascript/jquery-1.2.1.js"></script> <script type="text/javascript" src="javascript/functtions.js"></script> <link rel="stylesheet" type="text/css" href="css/styles.css"></link> <title>Untitled Document</title> </head> <body> <div class="TableOne"> <table onmouseover="swap();" onmouseout="swap();"> <tr> <th><a href="#" onMouseOver="swap();" onMouseOut="swap();">гостевая</a></th> <th><a href="#">гостевая</a></th> <th><a href="#">гостевая</a></th> <th><a href="#">гостевая</a></th> </tr> </table> </div> функция swap function swap() { $('tr > th').toggleClass('striped'); } меняет background-color но color не работает .striped { background-color:#FFFFFF; color:#00cc33; }
<script src="http://code.jquery.com/jquery-latest.js"></script> <style type="text/css"> .striped a:visited, a:link{ background-color:#ffffff; color:#00cc33; } </style> <script> $(document).ready(function(){ $("th").mouseover(function(){ $(this).toggleClass('striped'); }).mouseout(function(){ $(this).toggleClass('striped'); }); }); </script> <title>Untitled Document</title> </head> <body> <div class="TableOne"> <table> <tr> <th><a href="#">гостевая</a></th> <th><a href="#">гостевая</a></th> <th><a href="#">гостевая</a></th> <th><a href="#">гостевая</a></th> </tr> </table> </div>