Idiomatic mode to call a jQuery function on a Javascript object?

advertisements

Given a Javascript DOM object, what is the most idiomatic way of calling a jQuery function on it? Currently, I am using:

$('#' + object.id).someFunction()

However, this doesn't feel quite right. Isn't there a better way?


This should work

 $(object).someFunction();

You can see it live here: http://jsfiddle.net/XsKXU/

See this documentation for reference on the $ (aka jQuery) function