473,508 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE munges innerHTML

IE seems to munge the innerHTML of a document, does anyone know why
it's changing the innerHTML?

<body>

<div style="background-color:LightGrey;" onclick="window.alert( 'one:'
+ getElementById('one').innerHTML );" id="one">
<table id="tableone">
<tr id="trone">
<td>click me</td>
</tr>
</table>

</div>

<div id="two" style="background-color:LightBlue;"
onclick="window.alert( 'two:' + getElementById('two').innerHTML );">
<table id="tabletwo">
<tr id="trtwo">
<td>click me too</td>
</tr>
</table>
<input type="checkbox" checked="checked" value="MYVAL" />
</div>
</body>

Jul 23 '05 #1
4 2226
ml*******@gmail.com writes:
IE seems to munge the innerHTML of a document, does anyone know why
it's changing the innerHTML?


You forgot to tell us what the problem is. As far as I can see, IE
does exactly as I would expect. What are your expectations, and how
does IE fail to meet them? (I.e., what did you expect to happen and
what really happened?)

If you are referring to the TBODY element, then it's there in the HTML
too - you just can't see it. All TABLE elements *must* contain at
least one TBODY element, but both start and end tag can be omitted.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2

Does what? Have a Query? and .innnerHTML works fine for me in IE.
Danny

On Fri, 08 Jul 2005 13:49:46 -0700, <ml*******@gmail.com> wrote:


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 23 '05 #3
ml*******@gmail.com wrote:
IE seems to munge the innerHTML of a document, does anyone know why
it's changing the innerHTML?

<body>

<div style="background-color:LightGrey;" onclick="window.alert( 'one:'
+ getElementById('one').innerHTML );" id="one">


There is no need for getElementById, you can use 'this':

... + this.innerHTML );" id="one">
[...]

--
Rob
Jul 23 '05 #4
On Fri, 08 Jul 2005 23:26:10 +0200, Lasse Reichstein Nielsen
<lr*@hotpop.com> wrote:
If you are referring to the TBODY element, then it's there in the HTML
too - you just can't see it. All TABLE elements *must* contain at
least one TBODY element, but both start and end tag can be omitted.


Watch out if you've got an XHTML document though, where this rule
differs.

Jim.
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
70727
by: Chris | last post by:
How can I get the innerHTML of a <div> area only when the page loads, then use that variable in a function? Here is my code: function setContent(zz) { var lb =...
7
3459
by: KK | last post by:
Please help! I am currently experiencing a bug in Safari v125.9. When I modify the value of form input box and then get the innerHTML property of the surrounding div object - I am returned the...
4
6532
by: RobG | last post by:
I know you aren't supposed to use innerHTML to mess with table structure, but it seems you can't use it just after a table without damaging the containing element. I added a table to a div using...
9
8634
by: Hallvard B Furuseth | last post by:
Why does the FAQ (Q 4.15) recommend innerHTML when so many here say one should use createElement(), replaceChild() etc? Also, why does the "Alternative DynWrite function" at...
2
9540
by: sveinn | last post by:
Hi all, I've read through this group searching for an answear about this problem. Few have come close but not quite what I need. My problem is this: I'm using Ajax to fetch a new table with...
17
34666
by: PJ | last post by:
Greetings... I have stumbled upon a small problem. I use Ajax to retrieve part of a page I need to update. I update a DIV element with the HTML contents I get from another page. It works...
9
3345
by: martymix | last post by:
simple question: I have a simple <dt>test text</dt> I get the innerHTML of that dt, and I try and append some text to it like so: dt = document.getElementsByTagName('dt') var text =...
6
4205
by: PaPa | last post by:
I'm not sure this is a javascript issue or an HTML issue. I notice that when I extract the contents of a div using the innerHTML property (?), that I wind up with a literal variable (?) which...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7118
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.