I already have 3 Javascripts working that I trigger within my <td>'s like this:

<td onMouseOver="mover(this)" onMouseOut="mout(this)" onClick="mclick('test.html')">Test Button</td>

I have now coded up 1 Javascript function to handle all 3 events (using if statements).

But how do I trigger the calling of that function inside my <td>'s? I was hoping there would be some kind of general “onEvent” but haven’t found one:

<td onEvent="mousebutton( this, event, 'test.html' )" >Test Button</td>

(I’m assuming this is an HTML question since my Javascript per se is working. But do please let me know if this would be more appropriate in another forum.)


where javascript is used, it is the initial script trappping the 3 events separately, more currently use css to change appearance on mouseover(css hover), javascsript is often disabled as a security issue
havent seen any generic onEvent handler except in tutorial pages where it is a teaching aid followed up with the list of possible events.
You could write a onevent handler, but it would add complexity and slow things down, rather than simplify and speed up

/* css for mouseover */

td { text-decoration:none; }
td:hover { background-color:#66cdaa; text-decoration:bold; }

its a pale turquoise color background, its awful , but it suits my layout

Okay! I see how that can work. Your method is much better than mine, and I will try it. (While I have been trying to put everything possible and reasonable into CSS, I had not realized the hover could be so customized.)


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.