JQuery.append () Function
3 answers
Because the browser needs to (re) build its DOM after every add. It cannot know that the closing tag will come later, and the opening tag itself is not valid, so the bug fix hits where the unclosed element is closed in this case.
This is one reason why, innerHtml
and things that rely on it (like the jQuery add method) are unreliable and should be avoided whenever possible.
+2
a source to share