From jQuery Docs:
At present, the only operations supported on plain JavaScript objects
wrapped in jQuery are: .data(),.prop(),.bind(), .unbind(),.trigger()
and .triggerHandler(). The use of .data() (or any method requiring
.data()) on a plain object will result in a new property on the object
called jQuery{randomNumber} (eg. jQuery123456789).
You can wrap a plain object in a jQuery object and use those functions.
Also from the same page:
// define a plain object
var foo = {foo:'bar', hello:'world'};
// wrap this with jQuery
var $foo = $(foo);
// test accessing property values
var test1 = $foo.prop('foo'); // bar
// test setting property values
$foo.prop('foo', 'foobar');
var test2 = $foo.prop('foo'); // foobar
// test using .data() as summarized above
$foo.data('keyName', 'someValue');
console.log($foo); // will now contain a jQuery{randomNumber} property
// test binding an event name and triggering
$foo.bind('eventName', function (){
console.log('eventName was called');
});
$foo.trigger('eventName'); // logs 'eventName was called'