Hello,

I'm creating a script like this:
Code:
this is <span onmouseover="callafunction()" onmouseout="callafunction()"><span onmouseover="callafunction()" onmouseout="callafunction()">inner text</span> inside another span</span> and this is outer text.
As you can see, there are <span>'s with the same onmouseover and onmouseout event, and these will be a lot, is there any way to make the code neater?

I'm thinking to use DHTML to add the events on runtime, so in my code it will be like this:
Code:
this is <span><span>inner text</span> inside another span</span> and this is outer text.
then I'll scan and add the onmouse* events to the <span>'s, is it possible? which one is lighter for browser? I assume if it's lighter then it will be faster too, both on loading and processing time.

Your opinion please, thanks in advance.