Sto cercando di estendere tutti gli elementi dom in modo da poter ottenere e rimuovere i loro figli. La funzione è sotto (funziona in FF e Chrome). Esiste un equivalente in IE7 per estendere l'oggetto dom base?Element.prototype in 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);
}
Grazie!
vittima http://stackoverflow.com/questions/592815/is-there-really-no-way-to-expose-the-prototype-of-a-html-element-in-ie-8/ – bobince