Unsere Freiwilligen haben diesen Artikel noch nicht in Deutsch übersetzt. Machen Sie mit und helfen Sie, das zu erledigen!
Sie können den Artikel auch auf English (US) lesen.

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

Syntax

userData = someNode.getUserData(userKey);

Parameters

  • 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);
console.log(document.getUserData('key')); // 15

Specifications

Specification Status Comment
DOM
The definition of 'Node' in that specification.
Living Standard Removed from the specification.
Document Object Model (DOM) Level 3 Core Specification
The definition of 'Node.getUserData()' in that specification.
Obsolete Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No ?1 — 22 ? No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No No ?4 — 22 No No ?

See also

Schlagwörter des Dokuments und Mitwirkende

Schlagwörter: 
Zuletzt aktualisiert von: fscholz,