MCPcopy Create free account
hub / github.com/prototypejs/prototype / purge

Function purge

src/prototype/dom/dom.js:1218–1228  ·  view source on GitHub ↗

* Element.purge(@element) -> null * * Removes all event listeners and storage keys from an element. * * To be used just before removing an element from the page.

(element)

Source from the content-addressed store, hash-verified

1216 * To be used just before removing an element from the page.
1217 **/
1218 function purge(element) {
1219 if (!(element = $(element))) return;
1220 purgeElement(element);
1221
1222 var descendants = element.getElementsByTagName('*'),
1223 i = descendants.length;
1224
1225 while (i--) purgeElement(descendants[i]);
1226
1227 return null;
1228 }
1229
1230 Object.extend(methods, {
1231 remove: remove,

Callers

nothing calls this directly

Calls 2

$Function · 0.85
purgeElementFunction · 0.85

Tested by

no test coverage detected