<body>
<script>
function aa(arg_color){
if( typeof(document.all('t1').length) != "undefined"){
var oTable = document.all('t1');
for(var i =0;i < oTable.length;i++)
oTable[i].style.color = arg_color;
}
}
</script>
<table id=t1 style='color:red' onmouseover='aa(this.style.color);'> <tr><td>a</td><td>b</td></tr></table>
<table id=t1 style='color:green' onmouseover='aa(this.style.color);'> <tr><td>c</td><td>d</td></tr></table>
</body>
<script>
function aa(arg_color){
if( typeof(document.all('t1').length) != "undefined"){
var oTable = document.all('t1');
for(var i =0;i < oTable.length;i++)
oTable[i].style.color = arg_color;
}
}
</script>
<table id=t1 style='color:red' onmouseover='aa(this.style.color);'> <tr><td>a</td><td>b</td></tr></table>
<table id=t1 style='color:green' onmouseover='aa(this.style.color);'> <tr><td>c</td><td>d</td></tr></table>
</body>
<script>
function aa(arg_color){
if( typeof(document.all('t1').length) != "undefined"){
var oTable = document.all('t1');
for(var i =0;i < oTable.length;i++)
oTable[i].style.color = arg_color;
}
}
</script>
<table id=t1 style='color:red' onmouseover='aa(this.style.color);'> <tr><td>a</td><td>b</td></tr></table>
<table id=t1 style='color:green' onmouseover='aa(this.style.color);'> <tr><td>c</td><td>d</td></tr></table>
</body>
TD{Define:onmousemove=new function(if(id=="TDID"){this.style.bgColor='#EEEEEE';})}
</style>
function aa(arg_color){
var t = document.all('t1');
if(typeof(t.length)=="undefined")t=[t];
for(var i =0;i < t.length;i++)
t[i].style.color = arg_color;
}
不好意思啊,我javascript很菜,请多多指教,答了马上给分
function aa(id, arg_color){
var t = document.all(id);
if(typeof(t.length)=="undefined")t=[t];
for(var i =0;i < t.length;i++)
t[i].style.color = arg_color;
}
</script>
<table id=t1 onmouseover='aa(this.id, "red");'> <tr><td>a</td><td>b</td></tr></table>
<table id=t1 onmouseover='aa(this.id, "green");'> <tr><td>c</td><td>d</td></tr></table>