I have jquery function:
function handleSplittingPrices() {
var customerId = $(this).val();
loadSplittingPrices(customerId);
}
I want to execute it with elem as “this”:
var elem=$('...');
handleSplittingPrices() <-- here elem will be this
How can I do it?
You’re looking for the
callmethod:Note that
elemis a jQuery object, not a DOM element, so you won’t need to call$inside the function.