How to highlight a table cell when clicked...why doesn't this work?
why doesn't this work for hilighting a grid cell when clicked, assuming the function is called when the cell is clicked:
function hiLight() {
var table = Tiggr("stratGrid");
table.style.backgroundColor="white";
var cells = table.getElementsByTagName("td");
for (var i=0; i < cells.length; i++) {
var divs = cells.getElementsByTagName("div");
for (var j=0;, j < divs.length; j++ {
var status = divs[j].getAttribute("data-role");
Code: Select all
if (status == "tiggr_label") {
var label = divs[j];
if (label.val == localStorage.getItem('v_strat_id') {
cells[i].style.backgroundColor="red";
}
}
}
}
};