Creating subclass of HTMLDivElement - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Div

Description

Creating subclass of HTMLDivElement

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//  w  ww.j av a  2 s. c  om


    function subC() {
        //w/e
    }
    subC.prototype = document.createElement('div');
    var x = new subC();
    console.log(x instanceof HTMLDivElement);


    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials