We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE

This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The Node.getUserData() method returns any user DOMUserData set previously on the given node by Node.setUserData().

The Node.setUserData and Node.getUserData methods are no longer available from Web content. Element.dataset or WeakMap can be used instead.


userData = someNode.getUserData(userKey);


  • 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.


var d = document.setUserData('key', 15, null);
alert(document.getUserData('key')); // 15


Specification Status Comment
Living Standard Removed from the specification.
Document Object Model (DOM) Level 3 Core Specification
Obsolete Initial definition.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 未实现 Supported from 1.0 (1.7 or earlier) to 21.0 (21.0).
Removed in 22.0 (22.0) [1]
? 未实现 未实现
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 未实现 Supported from 1.0 (1.0) to 21.0 (21.0).
Removed in 22.0 (22.0) [1]
(Yes) 未实现 未实现

[1] The method is still available from chrome scripts.

See also


 此页面的贡献者: teoli, AlexChao
 最后编辑者: AlexChao,