Hey guys, i cannot figure out why this portion of my code is not doing as expected.
[CODE]var row = document.createElement(‘TR’);
row.setAttribute(‘onmouseover’,’this.style.color=”white”;this.style.backgroundColor=”#2172A1″; this.style.cursor=”default”;’);
row.setAttribute(‘onmouseout’,’this.style.backgroundColor=”white”;’);
The row changes color, but the text does not. It works fine if i do it for the cell itself.
Also, this code doesnot work at all in IE. I was told to use a different approach which would be:
[CODE]try{
var row = document.createElement(‘<tr style=”color=white;backgroundColor=#2172A1;”>’);
}catch(e){
var row = document.createElement(‘TR’);
row.setAttribute(‘onmouseover’,’this.style.color=”white”;this.style.backgroundColor=”#2172A1″; this.style.cursor=”default”;’);
row.setAttribute(‘onmouseout’,’this.style.backgroundColor=”white”;’)
}
I would just like to know as to what i am doing wrong here, i don’t want you guys to completly re-write the code, cause i would likt to try once i get an explanation as to what im doing incorrect.