Javascript 如何在jquery中隐藏类似td的acordian

Javascript 如何在jquery中隐藏类似td的acordian,javascript,html,Javascript,Html,我有一张表格如下: 它的左侧列出了菜单,顶部是徽标,右侧是实际内容,如列出数据等 现在我想在用户单击时隐藏菜单,并在再次单击时启用 如何在java脚本中实现这一点 下面是示例的图像: 这帮助我实现了我想要的 <!DOCTYPE html> <html> <head> <script src="jquery-latest.js"></script> </head> <body> <table&g

我有一张表格如下:

它的左侧列出了菜单,顶部是徽标,右侧是实际内容,如列出数据等

现在我想在用户单击时隐藏菜单,并在再次单击时启用

如何在java脚本中实现这一点

下面是示例的图像:


这帮助我实现了我想要的

<!DOCTYPE html>
<html>
<head>

  <script src="jquery-latest.js"></script>

</head>

<body>
  <table>
    <tr>
        <td id="cell">
            Some info
        </td>
    </tr>
</table>

<input type="button" id="button" value="Show/hide" />
<script>
$("#button").click(function(){
     $("#cell").toggle();
});
</script>
</body>
</html>

一些信息
$(“#按钮”)。单击(函数(){
$(“#单元格”).toggle();
});
更新


此处的在线演示:

请显示您的实际加价,而不是加价输出的图片。感谢您的评论,请查看我的答案。它按照我的要求工作