[thelist] Basic JavaScript question

Hassan Schroeder hassan at webtuitive.com
Sat Oct 18 11:06:04 CDT 2003


john at johnallsopp.co.uk wrote:

> Here's what I think I want to do:
> 
> <td class="menuTable"><a href="news.jsp" class="menuText" onmouseover="var
> m22 = getElementById('m22'); m22.firstChild.nodeValue='<div
> class='menuText';>Hello</div>';">News</a></td>

No you don't :-)  Forget the quoting, you need to rethink this --
m22.firstChild.nodeValue = wha?

"firstChild" is one node, not *three*: you're munging a tag node
('div'), attribute node ('class') and text node `Hello` into one.

Are you intending to change all three? Or just the text part?

-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.





More information about the thelist mailing list