title: Inheriting from the DOM Element object in javascript ! Whats wrong with this code?
body: <p>I am trying to inherit from the DOM Element object,all code runs fine when I create the object but when I try to call the appendChild() method ,it gives an error saying :</p>
  
  <pre><code>MyObject doesn't have an appendChild method
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>var content=document.createTextNode("This was dynamically created");
  function MyObject(tagName){
      Element.constructor.call(this,tagName);
      this.prototype=Element.prototype;
      this.prototype=Object.defineProperties(this.prototype,{
         newMethod:function(){
         //dosomething
  
         }
      });
  }
  var newObj=new MyObject("div");
  newObj.appendChild(content);
  </code></pre>