Modifying an event

W

Wojtek

I have the following:

<tr onMouseOver="alert('Over a row')">

and I want to modify the event to be:

<tr onMouseOver="alert('Over THIS row')">

in other words reaching into the event, and changing some part of it.

I have tried walking through the attributes of the <tr> until I reach
the onclick, then changing its value, but that throws an error.
 
D

dhtmlkitchen

I have the following:

<tr onMouseOver="alert('Over a row')">

and I want to modify the event to be:

<tr onMouseOver="alert('Over THIS row')">

in other words reaching into the event, and changing some part of it.

I have tried walking through the attributes of the <tr> until I reach
the onclick, then changing its value, but that throws an error.

I don't really understand why you would want to change the event. In
anycase, this code may or may not help you learn something:

onmouseover="showRow( event, this )"

function showRow( ev, row ) {
var target = ev.target;
var isRowTarget = ( row == target );
alert( "row == target: " + isRowTarget )
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,416
Latest member
LionelQ387

Latest Threads

Top