your native ways are not the same as the one you presented using jQuery.
"<a><a/></a>" is a complex html string, which means it gets passed to innerHTML (explained in the documentation)
- var div = document.createElement("div");
- div.innerHTML = "<a><a/></a>";
- console.log(div.innerHTML);
it gives you "<a></a><a></a>"
This isn't a jQuery problem. make your html more precise.
- var div = document.createElement("div");
- div.innerHTML = "<a><a></a></a>";
- console.log(div.innerHTML);
-- Kevin