求JS或jquery实现部分选中的代码

xy325432 2011-01-11 04:01:53
<tr>
<td style="font-weight: bold;">
<input type="checkbox" name="4" id="4" value="4" />通知公告

</td>
</tr>
<tr>
<td>

<input type="checkbox" name="4" id="5" value="5" />发信息  

<input type="checkbox" name="4" id="6" value="6" />收件箱  

<input type="checkbox" name="4" id="7" value="7" />发件箱  

<input type="checkbox" name="4" id="8" value="8" />草稿箱  

<input type="checkbox" name="4" id="9" value="9" />投票  

<input type="checkbox" name="b" id="10" value="10" />园长查看  

</td>
</tr>


<tr>
<td style="font-weight: bold;">
<input type="checkbox" name="11" id="11" value="11" />信息多多

</td>
</tr>
<tr>
<td>

<input type="checkbox" name="11" id="12" value="12" />信息论坛  

<input type="checkbox" name="11" id="13" value="13" />照片集锦  

</td>
</tr>


<tr>
<td style="font-weight: bold;">
<input type="checkbox" name="14" id="14" value="14" />饮食保健

</td>
</tr>
<tr>
<td>

<input type="checkbox" name="14" id="15" value="15" />免疫  

<input type="checkbox" name="14" id="16" value="16" />体检  

<input type="checkbox" name="14" id="17" value="17" />营养膳食  

</td>
</tr>


上面都是从数据库中动态取出并加载的数据,要求实现选中“通知公告”时,“通知公告”的二级菜单“发信息”到“园长查看”都必须选中,而其他的不变,当“通知公告”的二级菜单中有未选中时,“通知公告”将取消选中状态。
也就是实现单个一级菜单和其下的二级菜单的选中。
不知道实现这个功能的JS或jquery代码怎么写呢?
...全文
77 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
xy325432 2011-01-11
  • 打赏
  • 举报
回复
补充下:也就是实现 分组全选 的功能

50,523

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧