日期:2014-05-16  浏览次数:20323 次

关于鼠标悬浮在td上,即更换表格错误,谢谢!
想实现鼠标悬浮在“显示11”上,则id为11的table可见,id为22的table不可见!~

<html>
<head>

</head>
<body>
<script   language= "javascript ">
function   showaa(par)
{
document.getElementById( "11 ").style.display   =   "none ";
document.getElementById( "22 ").style.display   =   "none ";
document.getElementByID(par).style.display   =   " ";
}

</script>
<table   border= "1 "   width= "40px ">
<tr>
<td   onmouseover= 'showadv( "11 ") '> 显示11 </td>
<td   onmouseover= 'showadv( "22 ") '> 显示22 </td>
</table>
<table   id= "11 "   border= "1 "   width= "200px "   style= "display: ">
<tr> <td> 这个是11 </td> </tr>
</table>
<table   id= "22 "   border= "1 "   width= "200px "   style= "Display:none ">
<tr> <td> 这个是22 </td> </tr>
</table>
</body
</html>

------解决方案--------------------
不要用数字做为id开头.

function showaa(obj1, obj2)
{
document.getElementById(obj1).style.display = "none ";
document.getElementById(obj2).style.display = " ";
}