MCPcopy Index your code
hub / github.com/prototypejs/prototype / store

Function store

src/prototype/dom/dom.js:3138–3148  ·  view source on GitHub ↗

* Element.store(@element, key, value) -> Element * Element.store(@element, object) -> Element * * Stores a key/value pair of custom metadata on the element. If it is * given one argument instead of two, it treats that argument as an object * of key/value pairs, and stores _each_

(element, key, value)

Source from the content-addressed store, hash-verified

3136 * The metadata can later be retrieved with [[Element.retrieve]].
3137 **/
3138 function store(element, key, value) {
3139 if (!(element = $(element))) return;
3140 var storage = getStorage(element);
3141 if (arguments.length === 2) {
3142 // Assume we've been passed an object full of key/value pairs.
3143 storage.update(key);
3144 } else {
3145 storage.set(key, value);
3146 }
3147 return element;
3148 }
3149
3150 /**
3151 * Element.retrieve(@element, key[, defaultValue]) -> ?

Callers

nothing calls this directly

Calls 2

$Function · 0.85
getStorageFunction · 0.85

Tested by

no test coverage detected