Hi,
I'm currently trying to create a very particular rollover effect.
I need to programmaticall y modify a number of images.
A short example of the current html, which I'm trying to modify.
In this example there are only 2 SPANs but there could be many more.
When the mouseover event is triggered, the mouseover function receives the link object. I can use this to go through the SPAN's using childNodes. However I cant figure out how to rewrite the SPANs content!
All I need to do is modify each
to
.
There is only ever 1 IMG inside a SPAN.
Any help would be greatly appreciated.
Thanks
PS. If I have missed the obvious its because this is my second day learning JavaScript so apologies in advance.
I'm currently trying to create a very particular rollover effect.
I need to programmaticall y modify a number of images.
A short example of the current html, which I'm trying to modify.
Code:
<a href="temp.html"onMouseOver="mouseover(this);"><span class="p1CE"><img src="1.png"></span><span class="p1CB"><img src="1.png"></span></a>
When the mouseover event is triggered, the mouseover function receives the link object. I can use this to go through the SPAN's using childNodes. However I cant figure out how to rewrite the SPANs content!
All I need to do is modify each
Code:
<img src="1.png">
Code:
<img src="1hl.png">
There is only ever 1 IMG inside a SPAN.
Any help would be greatly appreciated.
Thanks
PS. If I have missed the obvious its because this is my second day learning JavaScript so apologies in advance.
Comment