Table of contents
- 1. Summary
- 2. Syntax
- 3. Example
- 4. Specification
- 5. See also
Summary
Returns any user data set previously on the given node by setUserData().
Syntax
userData = someNode.getUserData(userKey);
userDatais the data that had been stored previously bysetUserData()ornullif none.someNodeis the node for which user data is being sought.userKeyis the key to choose the specific data sought for the given node. More than one key may have been assigned on a given node, containing its own value.
Example
var d = document.setUserData('key', 15, null);
alert(document.getUserData('key')); // 15


Mozilla Developer Network