Skip to content

Instantly share code, notes, and snippets.

@zhanggang807
Last active September 27, 2018 02:30
Show Gist options
  • Save zhanggang807/648a5c1d0ffcb257b0b731252cac324b to your computer and use it in GitHub Desktop.
Save zhanggang807/648a5c1d0ffcb257b0b731252cac324b to your computer and use it in GitHub Desktop.
get all of td from a table tag
var rows = document.getElementById('grid-table').rows
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
var tds = row.children;
for (var j = 0; j < tds.length; j++) {
var td = tds[j];
//console.log(td.getAttribute("title"))
if (td.getAttribute("title") == '0'){
td.click();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment