Node.getUserData

Table of contents

  1. 1. Summary
  2. 2. Syntax
  3. 3. Example
  4. 4. Specification
  5. 5. See also
Table of contents
  1. 1. Summary
  2. 2. Syntax
  3. 3. Example
  4. 4. Specification
  5. 5. See also

« Gecko DOM Reference

Summary

Returns any user data set previously on the given node by setUserData().

Syntax

userData = someNode.getUserData(userKey);
  • userData is the data that had been stored previously by setUserData() or null if none.
  • someNode is the node for which user data is being sought.
  • userKey is 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

Tags (3)

Edit tags

Attachments (0)

 

Attach file