Home > Web Front-end > JS Tutorial > Introduction to using Node traversal of js to find a field instance of repeater_javascript skills

Introduction to using Node traversal of js to find a field instance of repeater_javascript skills

WBOY
Release: 2016-05-16 17:35:19
Original
1132 people have browsed it
js part:
Copy code The code is as follows:

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; //Find tr node
if(trobj.rowIndex > 0){
var tdobj=trobj. children;
var amount = tdobj[3].children.item(0).value; //Find the value of the td node corresponding to the 4th td
alert(amount);
}
}
}

html repeater
Copy code The code is as follows :








Height="15">



Height= "15">






< ;/tr>


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