views:

267

answers:

2

Hello,

I have the following string elements that i want to append to the DOM, but in IE the tags do no close. Example:

$("#accordion").append('<div id="mydiv" class="sortme">bla bla bla</div><div id="panel" class="accordionPanel"></div>');

After IE render it the div elements for instance are rendered without closing tag. It was supposed to be "" and only shows ""

Any ideas what might be happenning here?

Thanks, TT

+4  A: 

Your tags aren't balanced:

<div id="mydiv" class="sortme">
bla bla bla
</div>
<div id="panel" class="accordionPanel">
</div>
</div>

ie you have an extra </div> at the end.

cletus
My mistake when copy/paste..... i edited now... but the issue persists
byte_slave
A: 

Try inserting the two divs with two separate append calls. I seem to recall a bug where trying to insert multiple sibling elements at once failed in IE.

Jimmy Cuadra
Well, i do not use IE very much and I started using their Developer Tools just 2 days ago, i found that in the mode of see the DOM elements the tags are not closed, but if i do some "view source" kinda thing, it shows the tags close.... but, for some reason the attributes now, do not get properly wrapped between "", Example: class = myclass rather then class="myclass"what the h*** is wrong here :(
byte_slave
It sounds like IE's developer toolbar tries to simplify the markup in a way that ultimately ends up being confusing. I would venture a guess that the lack of quotes around the class name is the same issue: the attributes appear correctly in the DOM but the way the IE developer toolbar display it is misleading.
Jimmy Cuadra