tvfoto
01-08-2007, 11:01 PM
Hello,
I want to mouseover on one table cell (<td>) and change the value of the header cell. I have no problem testing it this way:
<table border="1">
<tr>
<th id="hdr" width="50px"></th>
<td onmouseover="document.getElementById('hdr').innerHTML = '<p>heh</p>'";onmouseout="document.getElementById('hdr').innerHTML = ''";>mouseoverhere
</td>
</tr>
</table>
but when I try to apply the concept to the following, i have script error. I've tried number of ways to deal with single and double quotes and failed. Can you tell me what I did wrong? Thanks
<script>
......
doc = doc+"<td onmouseover='document.getElementById('hdr').innerHTML = '<p>heh</p>' " + " rowspan="+ height + " style='color:white;background:" + bkgcolor + "'"+">"+ "text here" +"</td>"
.....
</script>
I want to mouseover on one table cell (<td>) and change the value of the header cell. I have no problem testing it this way:
<table border="1">
<tr>
<th id="hdr" width="50px"></th>
<td onmouseover="document.getElementById('hdr').innerHTML = '<p>heh</p>'";onmouseout="document.getElementById('hdr').innerHTML = ''";>mouseoverhere
</td>
</tr>
</table>
but when I try to apply the concept to the following, i have script error. I've tried number of ways to deal with single and double quotes and failed. Can you tell me what I did wrong? Thanks
<script>
......
doc = doc+"<td onmouseover='document.getElementById('hdr').innerHTML = '<p>heh</p>' " + " rowspan="+ height + " style='color:white;background:" + bkgcolor + "'"+">"+ "text here" +"</td>"
.....
</script>