PDA

View Full Version : <td onmouseover...> in WRITELN


Gordo
09-25-2002, 02:14 AM
This barely belongs in the JS forum...almost put it in HTML/CSS. Anyway, I tried and tried, but my brain just isn't working (obviously). I'm VERY frustrated that I couldn't just "do this". It seems so simple. I hate to ask, but I'd rather look stupid to a few individuals than give my self a headache over it.

I need to add the following onmouseover background table cell changer within a JS writeln line.

A portion of the code:
for(var j=0;j<this.cols;++j) {
document.write('<td><span class="font8">')
document.write(this.data[i][j])
document.writeln('</span></td>')
}

I need to add the following...or whatever will get me the same results:
<td onmouseover="this.style.backgroundColor='#E1E1E1'" onmouseout="this.style.backgroundColor='#FFFFFF'" border-style: solid; border-color: #000000; background-color:#FFFFFF">

glenngv
09-25-2002, 03:41 AM
document.write('<td onmouseover="this.style.backgroundColor=\\'#E1E1E1\\'" onmouseout="this.style.backgroundColor=\\'#FFFFFF\\'" style="border-style: solid; border-color: #000000; background-color:#FFFFFF">');
document.write('<span class="font8">');


you missed the style=" :)