Click to See Complete Forum and Search --> : doesn't work in netscape...


cheese_stinks
02-13-2003, 08:30 PM
why doesn't this work in netscape 7??

<html>
<head>
</head>
<div name = "Hello" onClick = "alert(this.name)">Hello</div>
<body>
</body>
</html>

It works in ie but in netscape only if I use "id" instead of "name" and I can't use "id" because I used it for something else. Please help?

cheese_stinks
02-13-2003, 11:42 PM
Ohh.... thanks Dave! You seem to know everything. (darn - gotta think of a solution)

cheese_stinks
02-13-2003, 11:47 PM
Wait a minute... what's that way of creating the property you're talking about? I only need to store a reference id string that I look up in my script for the object. Thanks.

cheese_stinks
02-14-2003, 05:19 PM
... that wouldn't work... oh well, maybe I'll have to pass two parameters then. Thanks again anyway for your help.

cheese_stinks
02-14-2003, 07:55 PM
My script wouldn't work like that because I'm generating a div layer string and writing it with document.write and it's a bit more complicated than that, so... it wouldn't work.

cheese_stinks
02-15-2003, 12:04 AM
No, it's a bit more complicated than that. In the main js file I read a string from an external js file that specifies the data, parse it, and then send the parsed sections to a "renderer" which creates the div strings. The strings are then returned to the main script where they are written. That way it is possible for duplicate IDs to be created and it becomes weird to create the name properties.