W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2007

[whatwg] Setting innerHTML to null or undefined

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Mon, 4 Jun 2007 20:13:14 -0400
Message-ID: <6b9c91b20706041713k3e5dcfa8hc36945a932f6948d@mail.gmail.com>
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
page.

The way IE and Opera do "null" doesn't seem to be just limited to innerHTML.

-- 
Michael
Received on Monday, 4 June 2007 17:13:14 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:56 UTC