私はDOMを拡張しようとしています。私はdiv要素から「サブクラス」:appendChild()で追加できるJSオブジェクトは何ですか?
だから、var Subclass = function() {}
Subclass.prototype = document.createElement('div');
Subclass.constructor = Subclass;
var obj = new Subclass();
var obj.innerHTML = 'test';
document.body.appendChild(obj); // Exception: Node cannot be inserted ... point in the hierarchy
DOMオブジェクトされているオブジェクトのプロトタイプを行うことはありません場合は、DOMに挿入されるオブジェクトのための要件は何ですか?
関連:http://stackoverflow.com/questions/779880/in-javascript-can-you-extend-the-dom – Hamish