<![CDATA[
function boom()
{
document.execCommand("selectAll", false, null);
document.execCommand("selectAll", false, null);
document.execCommand("inserthtml", false, "<span><div>");
var textarea = document.getElementById("textarea");
textarea.appendChild(span);
}
]]>
</script></head><div contenteditable="true"></div><body onload="boom();"><textarea id="textarea">f</textarea></body></html>