Michael Lambert wrote:

> this only happens incidently, when i try to document.write out the div...
> typing it out in full seems to work (but will not do for the project im
> working on)
>
> "Michael Lambert" <[EMAIL PROTECTED]> wrote in message
> 9ll7ab$[EMAIL PROTECTED]">news:9ll7ab$[EMAIL PROTECTED]...
> > Im trying to create a <DIV> that consists only of an image...
> >
> > <DIV ID="' + this.id + '"><IMG SRC="/image/pic.gif"></DIV>
> >
> > The problem is Mozilla will not let me do this... when I try it simply
> wont
> > let me access  d.getElementById(this.id).style...
> >
> > When i add an ascii chacter to the DIV it WILL work however:
> >
> > <DIV ID="' + this.id + '"><IMG SRC="/image/pic.gif">L</DIV>
> >
> > Am I doing something wrong here?  Its impertitive I get this going as it
> > part of my sites navigation :(
> >
> > Thanks in advance,
> >
> > Mike
> >
> >

I don't know if you are trying to represent only, but:

The ID must be unique document-wide and the ID values must begin
with a letter (A-Z or a-z) and may be followed by any number of
letters, digits (0-9), hyphens (-), underscores (_), colons (:),
and periods (.).

(Spaces), (+) and (') are not permitted.
The value for the id attribute must be quoted.

Your sample:
  <DIV ID="' + this.id + '"><IMG SRC="/image/pic.gif"></DIV>
and:
  d.getElementById(this.id).style...

Should be:
  <div id="uniqueId"><img src="/image/pic.gif"></div>
and you access it with:
  d.getElementById("uniqueId").style.visibility = "hidden"
[note the quotation marks]

and the embedded stylesheet:
  <style type="text/css">
  #uniqueId { position: absolute; left: 54px; top: 25px; }
  </style>

Gus




Reply via email to