title: Create a new property and get element id?
body: <p>I want to create a new property and get id for elements (demo1, demo2, demo3).</p>
  <p>id: this.id = How do I get the id from the elements here?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Element.prototype.myData = {
    id: '1', 
    name: 'Caesar',
    title: 'Imperator'
    var att = "{id:"+id+";name:"+name+";title:"+title+"}";
    document.getElementById(this.id).setAttribute("myAtt", att); // get id of element
    
  };
  
  alert(document.getElementById("demo1").myData.id = "129"); // alert 129
  
  alert(document.getElementById("demo2").myData.id = "65"); // alert 65
  alert(document.getElementById("demo2").myData.name = "Aleksandar"); // alert Aleksandar
  
  alert(document.getElementById("demo3").myData.title); // alert Imperator</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="demo1"&gt;&lt;/div&gt;
  &lt;div id="demo2"&gt;&lt;/div&gt;
  &lt;div id="demo3"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>