Forum Moderators: open
I create a table using DOM - I get it all working in both IE and Firefox.
However IE does not like this bit:
var row = document.createElement("tr");
row.setAttribute('onMouseOver', 'changeColor(this, "#C0C0C0")');
row.setAttribute('onMouseOut', 'changeColor(this, "#FFFFFF")');
Both Firefox and IE will not throw an error at the code but only Firefox correctly displays the MouseOver and MouseOut effects. IE does not.
changeColor
function changeColor(object, color){
object.style.backgroundColor = color;
}
Anyone know why this is?
Thanks,
Lang
row.onmouseover = function () {
changeColor(row, '#c0c0c0');
};
row.onmouseout = function () {
changeColor(row, '#fff');
}