Dynamic Table and event handlers
Hi,
I am building a dynamic table using javascript and vbscript in a web page. The code goes something like this:
Code:
for x = 1 to 3
Set row = MyTable.insertrow()
for y = 1 to 3
set cell = row.insertcell()
cell.style.cursor = "hand"
cell.onmouseover = "javascript:this.style.backgroundColor='red';"
cell.onmouseout = "javascript:this.style.backgroundColor='White';"
next y
next x
What I want to happen is when you move over each of the cells in a table grid, the current one that the mouse is over changes color. But this code does not work?! Does anybody know why?
Thanks,
DJ