jquery append element from string + do not close tags properly
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 happe开发者_开发知识库nning here?
Thanks, TT
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.
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.
精彩评论