[thelist] DOM - .childNode and How to Target?

jono at charlestonwebsolutions.com jono at charlestonwebsolutions.com
Mon Apr 2 09:20:36 CDT 2007


>
> As the HTML stands (and provided it doesn't change) you can also
> change the text inside this cell with:
>
> var p = document.getElementById('target-b').getElementsByTagName('td')[2];
> p.firstChild.nodeValue = 'Email';
>
The above works perfectly!  Now I am working to make it work as an if
statement so it will work in both situations - as the login form and as
teh register form.

Any tips on how to wrap this into a if statement; or a better suggestion
would be wonderful. For example; I might try something like this)?):

<script type="text/javascript" language="javascript>
if {
var p = document.getElementById('target-b').getElementsByTagName('td')[2];
p.firstChild.nodeValue = 'Email';
}

if {
var p = document.getElementById('target-x').getElementsByTagName('td')[2];
p.firstChild.nodeValue = 'Email';
}
</script>

Surely my syntax is (way) off...the above is a shot in the dark - if you
haven't figured it out; I'm not JS guru.  Thanks, any  help here and I am
home free...for another day at least;)



More information about the thelist mailing list