You can do something like this:
Sub DoHover()
window.event.srcElement.style.color = "#FF0000"
End Sub
Sub UnHover()
window.event.srcElement.style.color = "#000000"
End Sub
.....<TD onmouseover="DoHover()" onmouseout="UnHover()"......
You can also do something like this:
Sub document_onmouseover()
If window.event.srcElement.tagName = "TD" Then
window.event.srcElement.style.color = "#FF0000"
End If
End Sub
But personally I prefer to use classes and IDs:
Sub document_onmouseover()
If window.event.srcElement.className = "TD248" Then
window.event.srcElement.style.color = "#FF0000"
End If
End Sub
Sub document_onmouseout()
If window.event.srcElement.className = "TD248" Then
window.event.srcElement.style.color = "#000000"
End If
End Sub
.... with something like this:
<TABLE><TR><TD Class="TD248"></TD>
<TD Class="TD248"></TD>
<TD Class="TD248"></TD>
<TD Class="TD248"></TD>
--
"Dave "Crash" Dummy" <inva...@invalid.invalid> wrote in message
news:jnmofl$b7e$1@dont-email.me...
|I have a table that contains 248 identical cells, differing only by the
| enclosed text:
|
| <td onMouseover="style.color='red'"
| onMouseout="style.color='black'"
| onClick="slashadd(this.innerText)">[string]</td>
|
| The idea is to have the cell act like a hyperlink, with a "hover" color.
| It works fine as shown, but is bulky. Is there some way I can use a single
| script function to remotely capture and act on events in multiple cells?
| --
| Crash
|
| Committed to the search for intraterrestrial intelligence.