Skip to content

Instantly share code, notes, and snippets.

@aerith
Created December 27, 2011 16:10
Show Gist options
  • Select an option

  • Save aerith/1524167 to your computer and use it in GitHub Desktop.

Select an option

Save aerith/1524167 to your computer and use it in GitHub Desktop.

Revisions

  1. aerith created this gist Dec 27, 2011.
    27 changes: 27 additions & 0 deletions pseudo.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    <html>
    <body>
    <script type="text/javascript">

    var hoge = function (name) {
    function f () {}

    var e = document.createElement(name);

    f.prototype = e;
    f.prototype.__super__ = e;
    f.prototype.__super__.constructor = e;

    return new f();
    }

    var e = new hoge('div');

    var d = document.createElement('div');
    d.innerHTML = 'hoge';
    e.appendChild(d);

    document.body.appendChild(e);

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