Skip to content

Instantly share code, notes, and snippets.

@aerith
Created December 27, 2011 16:10
Show Gist options
  • Save aerith/1524167 to your computer and use it in GitHub Desktop.
Save aerith/1524167 to your computer and use it in GitHub Desktop.
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment