Your Search Results

    Node.getUserData Redirect 1

    « DOM Reference « Node

    This feature has been removed from the Web. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.

    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
    DOM Living Standard Removed from the specification.
    Document Object Model (DOM) Level 3 Core Specification Recommendation Initial definition.

    Browser compatibility

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

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

    See also

    Document Tags and Contributors

    Contributors to this page: Sheppy
    Last updated by: Sheppy,