And before someone says:
document.querySelector('.myElem').getAttribute('data-*')
No, is not what I'm looking for. jQuery's data()
has dual functions. 1) It queries an HTML5 data attribute which can be seen in the HTML code like this:
<div data-role=page data-last-value=43 data-hidden=true data-options='{name:John}'></div>
$( div ).data( role ) === page;
$( div ).data( lastValue ) === 43;
$( div ).data( hidden ) === true;
$( div ).data( options ).name === John;
and 2) the ones that are set by .data(name, value)
which are hidden in a jQuery internal Object, to which the documentation only says to save information under the names 'events' and 'handle', yet I haven't figured out a way to access them or what actually creates them.
So, my question stands, how can I access the jQuery data values from plain JavaScript?
Just so it's absolutely clear... let me put more emphasis: I don't want the data-
HTML attributes, but the jQuery object data.