outerHTML is not inter-server.
The easiest way is to clone an element and add it to the parent element, and then get innerHTMLfrom this:
var outer = document.createElement('outer'),
child = document.getElementById("images").children[0].cloneNode(true);
outer.appendChild(child);
var imgHtml = outer.innerHTML;
source
share