title: How can I clone HTML Nodes with custom properties?
body: <p>I am working on a Editor and want to clone a HTML Node with custom properties using JavaScript.
  I only found <a href="https://stackoverflow.com/questions/11854283/why-does-clonenode-exclude-custom-properties">a way using setAttribute()</a> but it converts my custom attribute into a string:</p>
  
  <pre><code>// Using custom attributes
  var html = document.createElement("div");
  var obj  = {test: 123,html: html};
  html.obj = obj;
  var cloned = html.cloneNode(true);
  console.log(cloned.obj); // returns null
  
  // Using setAttribute
  var html = document.createElement("div");
  var obj  = {test: 123, html: html};
  html.setAttribute("obj") = obj;
  var cloned = html.cloneNode(true);
  console.log(cloned.getAttribute("obj")); // returns "[object Object]"
  </code></pre>
  
  <p>How do I clone the html element with the object?</p>