You can save this data in your own object using jQuery object references as keys, and then save this object in the document data. Sort of:
$.fn.objData = function(key, value) {
var rootData = $(document).data("jQueryObjectData");
if (!rootData) {
$(document).data("jQueryObjectData", rootData = {});
}
var objData = rootData[this];
if (!objData) {
rootData[this] = objData = {};
}
if (typeof value === "undefined") {
return objData[key];
}
objData[key] = value;
return this;
};
, :
$myObject.objData("foo", "bar");
:
var foo = $myObject.objData("foo");
, $myObject , jQuery, , - .
, jQuery, , . jQuery .