I need to trigger a custom event in the callback of a trigger
call, but I can\'t get it to work.
I tried this:
var $input = $( \".ui-pop
You need to use bind
or on
to add callbacks. In your case it should look like this:
var $input = $( ".ui-popup-container" ).find( "input" ).eq(2);
function runtests () {
console.log("clicked the input");
};
$input.bind('click', runtests);
Even shorter version for binding click is $input.click(runtests)
Then it will be called on click or you can trigger it manually with $input.trigger('click')
or simply $input.click()
.