Enhance the contains function to make it part of the JavaScript system (e.g. HTMLElement.prototype).
Utilisateur anonyme
HTMLElement.prototype.contains = function contains(b) { while ((this != b) && (b != null)) { b = b.getParent(); } return (this == b); }