I think it just needs a bit of documentation that elem is a DOM element, not a jQuery object. Also it should be noted that using jQuery.data(domElem, "key") will not pull in the HTML5 data-* attribute data-key="value" like calling jQuery(domElem).data("key") would.
I think it just needs a bit of documentation that
elem
is a DOM element, not a jQuery object. Also it should be noted that usingjQuery.data(domElem, "key")
will not pull in the HTML5 data-* attributedata-key="value"
like callingjQuery(domElem).data("key")
would.Here's an example showing how they fail: http://jsbin.com/exapef/1/edit