[whatwg] Setting innerHTML to null or undefined
Michael A. Puls II
shadow2531 at gmail.com
Mon Jun 4 17:13:14 PDT 2007
On 6/4/07, Jonas Sicking <jonas at sicking.cc> wrote:
> Anne van Kesteren wrote:
> > For .innerHTML = null Opera and Internet Explorer act as if the literal
> > string "null" was used. Firefox acts as if "" was used.
> > For .innerHTML = undefined Opera, Firefox and Internet Explorer act as
> > if the literal string "undefined" was used.
> I'd really dislike having to have this one property behave differently
> than other text properties in the DOM. How do opera/ie deal with other
> text properties like .src, .id, .textContent?
For .src and .id, IE and Opera set "null".
Opera does the same for textContent.
For .src, this obviously means that IE and Opera will then return the
directory of the page + "null" where as FF will return the URI to the
The way IE and Opera do "null" doesn't seem to be just limited to innerHTML.
More information about the whatwg