The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

NN JavaScript Problem

I have a textarea that is supposed to display a description for a book, and the description changes, depending upon which book cover is hovered over. Well, it works in IE 5.5, anyway. However, when I try it in NN 4.08, it complains "document.desc.bookDesc has no properties."

Here's the HTML code for the form:

Code:

<form name="desc" action="#">
<textarea name="bookDesc" rows="8" cols="60" class="bookDesc">
Hover over a book cover for a short description.
</textarea>
</form>

And here is the JavaScript:

Code:

var ttc_desc="It was the best of times, it was the worst of times.";
function describe(book) {
if (book!="") {
document.desc.bookDesc.value=eval(book+"_desc");
}
}

In the <img> tag of each book cover is this snippet:

Code:

onmouseover="describe('ttc')"

So why doesn't Netscape work with it? textarea.value is a JavaScript 1.0 property, so it's not like I'm trying to do something IE exclusive.

I've also tried just document.bookDesc.value, but I get the same error.