Home > Web Front-end > JS Tutorial > body text

利用js的Node遍历找到repeater的一个字段实例介绍_javascript技巧

WBOY
Release: 2016-05-16 17:35:19
Original
1057 people have browsed it
js部分
复制代码 代码如下:

var checkboxs = document.getElementsByTagName("input");
for(var i=0;i{
if(checkboxs[i].type=="checkbox" && checkboxs[i].checked==true){
var trobj=checkboxs[i].parentNode.parentNode; //找到tr节点
if(trobj.rowIndex > 0){
var tdobj=trobj.children;
var amount = tdobj[3].children.item(0).value; //找到td节点的value 对应第4个td
alert(amount);
}
}
}

html的repeater
复制代码 代码如下:








Height="15">



Height="15">









Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!