...

View Full Version : How can I change the text of this element?



dep
12-21-2005, 11:08 PM
I have the following HTML.

<li class="windowControl"><span id="detailsmaxlink"><img src="/images/refresh.gif" alt="Refresh" onclick="javascript:refresh('details')" class="refresh"><a href="javascript:maximize('details')">maximize</a></span></li>

I want to be able to replace the text "maximize" between <A HREF>...</A>

I don't know how to get to this via the DOM. i thought something like this would work.

document.getElementById('detailsmaxlink').childNodes[0].childNodes[0].nodeValue = 'restore'

but that doesn't work. What am I doing wrong?

liorean
12-21-2005, 11:18 PM
The first child is not the link, it's the image before it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum