title: Javascript multiple inheritance
body: <p>can anyone please help with the below code. I am trying to understand multiple inheritance not sure why its not working. BTW below if the code for multiple inheritance. Thanks </p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
  
      &lt;title&gt;Test Doc&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
      function classX(){
          this.messageX="this is X Message";
          this.alertX=function(){
              alert(this.messageX);
          };
      }
      function classY(){
          this.messageY="this is Y Message";
          this.alertY=function(){
              alert(this.messageY);
          };
      }
      function classZ(){
          classX.apply(this);
          classY.apply(this);
          this.messageZ="this is Z Message";
          this.alertZ=function(){
              alert(this.messageZ);
          };
      }
      var abjz=new classZ();
      objz.alertZ();
      abjz.alertX();
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>