Я пытаюсь расширить все элементы dom, чтобы я мог доставать и удалять своих детей. Функция ниже (работает в FF и Chrome). Есть ли в IE7 эквивалент для расширения базового объекта dom?Элемент.прототип в IE7?
if (!Element.get) {
Element.prototype.get = function(id) {
for (var i = 0; i < this.childNodes.length; i++) {
if (this.childNodes[i].id == id) {
return this.childNodes[i];
}
if (this.childNodes[i].childNodes.length) {
var ret = this.childNodes[i].get(id);
if (ret != null) {
return ret;
}
}
}
return null;
}
}
Element.prototype.removeChildren = function() {
removeChildren(this);
}
Спасибо!
боян http://stackoverflow.com/questions/592815/is-there-really-no-way-to-expose-the-prototype-of-a-html-element-in-ie-8/ – bobince