fork download
  1. <html>
  2. <head>
  3. <title> classes or prototypes </title>
  4.  
  5. <script language = "javascript" type = "text/javascript">
  6. function prototype()
  7. {
  8. this.name = "TVT" ;
  9.  
  10. this.prototype.class1 = function()
  11. {
  12. alert("inside the class function !!") ;
  13. }
  14. }
  15.  
  16. var obj = new prototype();
  17. obj.class1();
  18.  
  19.  
  20.  
  21. </script>
  22. </head>
  23.  
  24. <body>
  25. </body>
  26. </html>
Runtime error #stdin #stdout 0.26s 213120KB
stdin
Standard input is empty
stdout
Standard output is empty