<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="jquery-1.3.1.js" type="text/javascript">
</script>
</head><body>
<table width="600" border="0" cellspacing="0" cellpadding="0" id="tb1">
<tr>
<td width="100"><div align="center">首页</div></td>
<td width="100"><div align="center">新闻</div></td>
<td width="100"><div align="center">公告</div></td>
<td width="100"> </td>
<td width="100"> </td>
<td> </td>
</tr>
</table>
<script language="javascript">
$("#tb1 td").mouseover(function(){
$(this).attr("bgcolor","#990000");
});
$("#tb1 td").mouseout(function(){
$(this).removeAttr("bgcolor");
});
</script>
</body>
</html>
firefox或搜狗兼容模式可以,ie下却没反应,也不报错
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="jquery-1.3.1.js" type="text/javascript">
</script>
</head><body>
<table width="600" border="0" cellspacing="0" cellpadding="0" id="tb1">
<tr>
<td width="100"><div align="center">首页</div></td>
<td width="100"><div align="center">新闻</div></td>
<td width="100"><div align="center">公告</div></td>
<td width="100"> </td>
<td width="100"> </td>
<td> </td>
</tr>
</table>
<script language="javascript">
$("#tb1 td").mouseover(function(){
$(this).attr("bgcolor","#990000");
});
$("#tb1 td").mouseout(function(){
$(this).removeAttr("bgcolor");
});
</script>
</body>
</html>
firefox或搜狗兼容模式可以,ie下却没反应,也不报错
$("#tb1 td").mouseover(function(){
$(this).css("background","#990000");
});
$("#tb1 td").mouseout(function(){
$(this).css("background","");
});
$(this).css("background","#990000");
},
function(){
$(this).css("background","");
});