Home  >  Article  >  Web Front-end  >  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
WBOYOriginal
2016-05-16 17:35:191108browse
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>


Statement:
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