Well, I tried the following, and unfortunately it didn't work. For some reason it stopped execution of the code.
Code: Select all
eqRow.onclick = new Function( "changeColor(" + eqRow + ", " + newRow + ", 'rgb(240,234,194)', 'rgb(194,209,240)');" );
However, I did some digging around the net and found that this works...
Code: Select all
function addOnClick(obj, n)
{
obj.onclick = function() { changeColor(obj, n, 'rgb(240,234,194)', 'rgb(194,209,240)'); };
}
...
addOnClick(eqRow, newRow);
I don't really understand the reason behind WHY this works, but it does.