js如何获取table中动态生成的数据
来源:互联网 发布:js加载顺序控制 编辑:程序博客网 时间:2024/05/17 12:55
今天又学一招,多谢莉妹啦。
js如下:
$('#labe-table tr td #attrcode').each(function () { alert($(this).val());});
页面如下:
<table id="labe-table" class="labe-table" cellspacing="0" cellpadding="0" style="display: none"> <tbody> <tr> <th>参数编码</th> <th>参数名称</th> <th>单位(分钟)</th> <th>单价(元)</th> <th>备注</th> <th>单位类型</th> <th></th> <th></th> </tr> <tr> <td><input type="text" class="labe-text" id="attrcode" name="attrcode" value=""></td> <td><input type="text" class="labe-text" id="attrname" name="attrname" value=""></td> <td><input type="text" class="labe-text" id="attrunit" name="attrunit" value=""></td> <td><input type="text" class="labe-text" id="attrvalue" name="attrvalue" value=""></td> <td><input type="text" class="labe-text" id="remark1" name="remark1" value=""></td> <td><select class="labe-text" id="attrunittype" name="attrunittype" value=""><option>分钟</option><option>月</option></select></td> <td><input type="button" class="labe-btn" value="增加" onclick="addRow()"></td> </tr> </tbody> <tr><td colspan="2" class="list-cen"> <input type="button" class="btn-query" value="增加" onclick="save()"> <input type="button" class="btn-query" value="返回" onclick="javascript:history.go(-1)"></td> </tr> </table>
table中的行数是动态的,不是说一定就会有多少行多少行的,所以,这边使用的是juery的each()方法,对table的第一列进行遍历,后面将遍历的结果传入集合中去。
阅读全文
1 0
- js如何获取table中动态生成的数据
- 笔记-js中动态生成、删除table
- JS动态生成Table
- JAVA 爬虫获取js动态生成的网页数据
- 前台JS获取后台的Json数据, 动态创建table并填充数据
- 用js快速动态生成bootstrap table表格数据
- js动态生成table【转】js动态生成table【转】
- js动态生成table 经典
- mvc 动态生成table并将tb的数据放入相应的List<T>中 (1)
- mvc 动态生成table并将tb的数据放入相应的List<T>中 (2)
- 关于JS中如何获取动态加载的对象小结
- 获取动态生成的js元素
- c++获取lua中table的数据
- JS -- <table> 行号自增,前端动态生成的<tr>
- js 动态生成宽度固定的table控件
- js将后端返回的数据动态添加到table中
- jquery动态生成改变table的数据内容
- js动态修改、获取table单元格的内容
- Gaussian Filter from DFT
- 生成二维码
- AP 音频测试
- 配置OpenCV3.2.0教程
- TensorFLow 不同大小图片的TFrecords存取
- js如何获取table中动态生成的数据
- CString/string 区别及其转化
- 【Android】ViewPager探索
- 数据查询 --where
- Atlassian与DevOps 系列产品选择方案介绍
- Clion控制台乱码问题(JetBrains CLion 2017.2.2)
- git bash使用ppk
- 开发内核时怎么设置参数来挂接文件系统
- j4l Java实现识别图片中的数字 英文