Why this
$(\"#mydiv\").append(\"\");
$(\"#mydiv\").append(\"- Hello
\");
$(\"#mydiv\").append(\"
\");
alert($(\"#mydiv\").
Because the browser needs to (re)build its DOM after each append. It can't know that a closing tag will come later, and an opening tag by itself is invalid, so error correction kicks in which in this case closes the unclosed element.
This is one of the reasons why innerHtml and things that rely on it (such as jQuery's append method) are not reliable and should be avoided when possible.