Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DIV innerHTML IE bug strips leading table-related tags?

9 views
Skip to first unread message

mmcp...@gmail.com

unread,
Oct 4, 2005, 4:20:11 PM10/4/05
to
I'm trying to set the value of the innerHTML property (of a DIV) via
JavaScript. Specifically, I'm trying to set the value to a block of
HTML code that it just the table rows and table cells without the
containing TABLE tag. In other words, just TR and TD tags, no TABLE
tags.

When the innerHTML property is set, the first TR and TD are stripped
off and the innerHTML begins with the data contained inside the first
TD. However, the leading TR and TD are NOT stripped off if the value is
wrapped inside TABLE tags.

It appears that IE performs a validation on table related-content when
setting innerHTML. If the content is not a properly-formed table, then
it tries to remove the table markup.

Does anyone know how to turn off this validation so that the innerHTML
will accept what is passed to it without modifying it?

Thanks,
Mike

0 new messages