OLD | NEW |
---|---|
(Empty) | |
1 (function() { | |
2 | |
3 // A constructor function with the same name as a HTML element. | |
4 function HTMLDivElement(a) { | |
5 this.a = a; | |
6 } | |
7 | |
8 HTMLDivElement.prototype.bar = function() { | |
9 return this.a; | |
10 } | |
11 | |
12 HTMLDivElement.prototype.toString = function() { | |
13 return "HTMLDivElement(" + this.a + ")"; | |
14 } | |
15 | |
16 self.makeDiv = function(text) { | |
17 return new HTMLDivElement(text); | |
18 }; | |
19 | |
20 })(); | |
OLD | NEW |