title: Use prototype javascript in dom element
body: <p>Forgot my initial typo in original snippet here is exaly want I trying to do:</p>
  
  <p>How can I use prototyped variable in Dom element event?</p>
  
  <p>Suppose :</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>function MyProto(){
    this.valeur = "toto";
  }
  
  MyProto.prototype = {
    func1: function() {
       var t = document.createTextNode("func1 called ");
      document.body.appendChild(t);
      var br = document.createElement("br");
      document.body.appendChild(br);        
      this.func2();
    },
    func2: function() {
       var t = document.createTextNode("func2 called");
       document.body.appendChild(t);
    }
  };
  
  var proto = new MyProto();
  document.getElementById("myButton").addEventListener("click",proto.func1);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button id="myButton"&gt;Press here&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>In this example, when I press button it throw me this.func2 is not a function. I must to mention that ultimately the Dom element will be generated by HtmlHelper from Asp.Net MVC.</p>