嗨,我的菜单有一个表格结构,我需要能够从level2折叠/展开菜单,以便所有level3单元格可见.我的HTML是这样的:
<table>
<tr><td class="level1"><a href="abc.html">First Item</a></td></tr>
<tr><td class="level2"><a href="def.html">SecondItem</a></td></tr>
<tr><td class="level3"><a href="ghi.html">Third Item</a></td></tr>
<tr><td class="level3"><a href="jkl.html">Fourth Item</a></td></tr>
<tr><td class="level3"><a href="mno.html">Fifth Item</a></td></tr>
<tr><td class="level2"><a href="pqr.html">Sixth Item</a></td></tr>
<tr><td class="level2"><a href="stu.html">Seventh Item</a></td></tr>
</table>
Run Code Online (Sandbox Code Playgroud)
我怎么样,当我按下level2项目时,我只会折叠/展开level2后推送的level3项目?我只想为level2做这个,而不是为1级做.