<html>
<head>
<script language="javascript">
function expand(obj){
var tbl = document.getElementById("table0");
var len = tbl.rows.length;
var tr1 = obj.parentNode.parentNode;
var beginRow = tr1.rowIndex+1;
var img0=obj;
if(img0.alt=="点击展开")
{
img0.src="D://2.bmp";
img0.alt="点击收缩";
for(index = beginRow; index<len&&tbl.rows[index].id!="tr1"; index++)
{
tbl.rows[index].style.display='block';
}
}else
{
img0.src="D://1.bmp";
img0.alt="点击展开";
for(index = beginRow; index<len&&tbl.rows[index].id!="tr1"; index++)
{
tbl.rows[index].style.display='none';
}
}
}
</script>
</head>
<body>
<table id='table0' >
<tr id= "tr1">
<td>
<img src="D:/1.bmp" id=img onClick=expand(this) align=right alt="点击展开"/>
</td>
<td>
一级
</td>
</tr>
<tr id= "tr2" style="display:none">
<td>
</td>
<td>
二级
</td>
</tr>
<tr id= "tr2" style="display:none">
<td>
</td>
<td>
二级
</td>
</tr>
<tr id= "tr1">
<td>
<img src="D:/1.bmp" id=img onClick=expand(this) align=right />
</td>
<td>
一级
</td>
</tr>
</table>
</body>
</html>