Jump to content

form / table cell background colour change


chiprivers

Recommended Posts

assuming that the parent element of the checkbox is the cell, you can try something like this

 

function highlightCell(ele_id){

var ele = document.getElementById(ele_id);

var ele_parent = ele.parentNode;

var off = '#ccc', on = '#f00';

ele_parent.style.background = (ele_parent.style.background == on) ? off : on;

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.