<script language="javascript">
function change_view(obj_name)
{
var aa=document.getElementById(obj_name);
if(aa.style.display=="")
{
aa.style.display="none";
}
else
{
aa.style.display="";
}
}
</script>javascript
<table width="160" border="1">
<tr onClick="change_view('a1')">
<td>●樹形菜單根目錄1</td>
</tr>
<tr id="a1"style="display:none"> <!-- 若是想一打開網頁菜單就是展開的,此處刪除none--->
<td>
<table width="143" border="0">
<tr>
<td width="28"> </td>
<td width="105">二級菜單1</td>
</tr>
<tr>
<td> </td>
<td>二級菜單2</td>
</tr>
<tr>
<td> </td>
<td>二級菜單3</td>
</tr>
</table>
</td>
</tr>
<tr onClick="change_view('a2')">
<td>●樹形菜單根目錄2</td>
</tr>
<tr id="a2"style="display:none">
<td>
<table width="143" border="0">
<tr>
<td width="28"> </td>
<td width="105">二級菜單1</td>
</tr>
<tr>
<td> </td>
<td>二級菜單2</td>
</tr>
<tr>
<td> </td>
<td>二級菜單3</td>
</tr>
</table>
</td>
</tr>
<tr onClick="change_view('a3')">
<td>●樹形菜單根目錄3</td>
</tr>
<tr id="a3"style="display:none">
<td>
<table width="143" border="0">
<tr>
<td width="28"> </td>
<td width="105">二級菜單1</td>
</tr>
<tr>
<td> </td>
<td>二級菜單2</td>
</tr>
<tr>
<td> </td>
<td>二級菜單3</td>
</tr>
</table>
</td>
</tr>
</table>java