Method Inheritance Through Prototypes
<p>I wrote the following test code, I want <code>obj.my().showTxt()</code> to display "test1", but nothing is displayed, what error did I make?
Thanks!</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
Primitive and String Objects
&lt;script type="text/javascript"&gt;

    function Class1() {
        this.showTxt = function () { alert(this.name) }
    }

    Object.prototype.my = Class1;

    var obj = new Object();
    obj.name = "test1";

    obj.my().showTxt();

&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
