View Single Post
Old 02-04-2013, 04:17 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Use braces with your for statement (and if statement) - they are not optional. And every Javascript statement should be followed by a semi-colon ; except function, if, else, for, while, do, switch, and try.

Code:
for (var i = 0; i < el.parentNode.cells.length; i++) {
  el.parentNode.cells[i].style.backgroundColor='';
  el.style.backgroundColor=col;
}
"The louder he talked of his honour, the faster we counted our spoons." - Samuel Johnson
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Last edited by Philip M; 02-04-2013 at 04:19 PM..
Philip M is offline   Reply With Quote