[thelist] tying events and styles together in JS?

Tom Dell'Aringa pixelmech at yahoo.com
Wed Feb 19 10:15:01 CST 2003


Heres a question,

Say I have a page where I want every table row to have a onmouseover
and onmouseout event, in order to change the color of the row - so I
am doing this:

<tr onmouseover="this.className='on';"
onmouseout="this.className='off';" class="trHighLight">Stuff</tr>

If this is a page with 30 rows, thats a lot of code. If I have 10
pages that have this behavior, you get the picture.

Is there some way either in JS or otherwise that I can specify this
behavior for a TR instead of each time in the actual tag? It would be
even better if I could do it only for the TRs where a certain class
is.

Not sure if this is pie in the sky hoping or not..

Tom

=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com



More information about the thelist mailing list