I have td tags with the name HLC1. I cannot use getElementById for what my use is for this. I am updating an entire column with the same name. I can do this by accessing the class name like: nodes[i].className = "whateverclass", but I already have class names assigned and only need to change the background image.
function HLC(HLCnum) {
var nodes = document.querySelectorAll('[name=HLC1]');
var len = nodes.length;
for (i = 0; i < len; i++) {
// DOESNT WORK >> nodes[i].style.setProperty("backgroundImage", "url('../../../layout_images/bg_50percent_white.png')")
// DOESNT WORK >> nodes[i].style.backgroundImage = "url('../../../layout_images/bg_50percent_white.png')"
// DOESNT WORK >> nodes[i].style({ backgroundImage: "url('../../../layout_images/bg_50percent_white.png')" })
}
}

New Topic/Question
Reply



MultiQuote




|