function cloneImg (elem) {
var imgNode = document.createElement("div");
var attributes = elem.attributes;
for (var i in attributes) {
if(!attributes.hasOwnProperty(i)) {
continue;
}
var attr = attributes[i];
if(attr.name == 'class') {
imgNode.className = attr.value;
continue;
}
imgNode.setAttribute(attr.name, attr.value);
}
return imgNode;
}