jq遍历table 下的 td 添加类
2024-10-01 06:14:45
<script>
$('#btntb').click(function () {
$('#tab tr').each(function (i) { // 遍历 tr
$(this).children('td').eq(1).addClass('content');
//$(this).children('td').each(function (j) { // 遍历 tr 的各个 td
// // console.log($(this).text()); //});
});
}); //$(function () {
// $("#btn").click(function () {
// $("#test tr td:nth-child(2)").addClass('red');
// });
// $("#test tr").click(function () {
// $(this).children('td').eq(1).addClass('red');
// });
//});
window.onload = function () { }
</script>
$(this).children('td').eq(1).css({ "text-align" :"left" });
最新文章
- HBase的数据模型相关操作 使用t这个变量来代替table1
- Android学习笔记之使用LBS实现定位
- 【读书笔记】iOS-验证应用内支付的凭证注意事项
- ResponseUtil反射制造唯一结果
- How Big Is A Petabyte, Exabyte, Zettabyte, Or A Yottabyte?
- [Stephen]页面实现瀑布流源码
- Failed to load unit &#39;PATM&#39; (VERR_SSM_FIELD_NOT_CONSECUTIVE)
- 数学:UVAoj 11174 Stand in a Line
- TCP 连接的要点
- 使用RouteDebugger对MVC路由进行调试
- Front-End(五)——工具使用
- 《java入门第一季》之面向对象接口面试题
- redis安装linux(二)
- JS 实现兼容IE图片向左或向右翻转
- C语言程序设计II—第五周教学
- Android:XML简介 &; 解析方式对比(DOM、SAX、PULL)
- C#连接oracle连接字符串
- 【opencv基础】图像的几何变换
- Mysql binlog日志的介绍
- mysql慢查询监控及sql优化