Home  >  Article  >  Web Front-end  >  Script to traverse table using js_javascript skills

Script to traverse table using js_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:02:351004browse

var tableObj = document.getElementById("tableName");
var str = "";
for(var i=0;i{
   for(varj=0;j   {
      //str  = tableObj.rows[i].cells[j].innerHTML "   ";

           for(var z=0;z           {
        var text = tableObj.rows[i].cells[j].children[z];//取得text object
                str  = text.value;
           }
   }
   str ="n";
}
alert(str);


用js遍历 table

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