[thelist] Basic JavaScript question

john at johnallsopp.co.uk john at johnallsopp.co.uk
Sat Oct 18 09:44:26 CDT 2003


My brain's dead today, so answer me this if you will:

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>

But the 's around 'menuText' are not allowed obviously because the first
closes the one before '<div> and cocks the whole thing up.

I'm a tad confused between languages, I thought of using \' but I think
that's Perl. I tried " because " and ' alternate I think in PHP. And I
tried &apos; but that's HTML. So how, in JavaScript, do I overcome the "/'
issue?

And if anyone wants to improve my code that's fine too. Basically I'm
trying to change the contents of table cell b based on a rollover at cell
a .. a menu/submenu thing.

All help appreciated as always.
J




More information about the thelist mailing list