Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
目标是为 HTML 表中所选 td 右侧的所有 Td 分配一个类(使用 jQuery)。
例如,如果总共有 5 列 (td) 并且选择了第 2 个 td,则应为第 3、4、5 列分配一个特定的类。已尝试以下代码,该代码仅将类分配给立即权限 td 而不是进行中的..
$(this).parent('td').addClass("CheckMark"); $(this).parent('td').next('td').addClass("Green");
任何帮助将不胜感激。亲切的问候,
试试下面的代码:
$(this).parent('td').nextAll().addClass("Green");