Element.prototype no IE7?
Estou tentando estender todos os elementos dom para obter e remover seus filhos. A função está abaixo (funciona em FF e Chrome). Existe um equivalente no IE7 para estender o objeto dom base?
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);
}
Obrigado