62,040
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<script>
function test(id) //这个就公用的函数
{
document.getElementById(tableid).style.display='none';
}
</script>
</head>
<body>
<div id='div1' onclick='test("tableid")'> //这个tableid就可以换其他的
</div>
</body>
</html>
<html>
<head>
<script>
function test(id)
{
....
}
</script>
</head>
<body>
<div id='div1' onclick='test("div1")'>
</div>
</body>
</html>