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

jono at charlestonwebsolutions.com jono at charlestonwebsolutions.com
Mon Apr 2 09:05:50 CDT 2007

> As you have a class on the TD you could loop through all the TDs and
> get the first one that has a class of LoginCaption (they should really
> be labels).
--> Yes indeed, the html is bloated and invalid, but I cannot access it.

> 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';
--> I will give this a shot and see how it goes.

> More info:
> http://onlinetools.org/articles/unobtrusivejavascript/chapter2.html
> I've also done a screencast of the basics of the DOM:
> http://icant.co.uk/articles/domessentials/
-->  Thank you, bookmarking and reading shortly.

There is one other phase to this task; the login form changes dynamically
to a registration form if the user clicks the "Register" link.  The
registration form uses some of the same classes.  I will need to also
target the "User ID" text on the registration form and change it to "Email
Address" as well.

I will need to change your suggestion into an "if" statement (guessing
here) b/c the page remains the same, the html on the table dynamically
updates.  If I can get your suggestion working, I think I might be able to
get the if statement working...we'll see.

Thanks for your help, suggestions, and links thus far!  I will try your
suggestion and update the text case link I provided.

More information about the thelist mailing list