Changing 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 onMouseOver, then changing its value, but that throws an error.
 
M

Martin Honnen

Wojtek said:
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.

If you have the tr element object use
tr.onmouseover = function (evt) {
alert('Over THIS row');
};
 
W

Wojtek

Martin Honnen wrote :
If you have the tr element object use
tr.onmouseover = function (evt) {
alert('Over THIS row');
};

I cannot make this work. I still get an object error at that line, and
the original alert text is shown.

browser is IE 6. I tried it with the evt parameter and no parameter
 
D

David Mark

Wojtek said:
Martin Honnen wrote :

I cannot make this work. I still get an object error at that line, and
the original alert text is shown.

Post your code. Did you define tr?
 

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