Hi,
you need create that element at first.
for example:
var element=document.createElement("DIV");
element.style.position="absolute";
element.style.overflow="hidden";
element.style.width="1px";
element.style.height="1px";
document.body.appendChild(element);
var r = document.body.createTextRange() ;
r.moveToElementText(element) ;
r.execCommand("Paste") ;
sHTML = element.innerHTML ;
alert(sHTML);
Note: this is IE only. other browsers have difference API for the TextRange
Regards,
Terry