KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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-popup-container" ).find( "input" ).eq(2); function runtests () { console.log("clicked the input"); }; $input.trigger('click', runtests()); and this: var $input = $( ".ui-popup-container" ).find( "input" ).eq(2); $input.trigger('click', function(){ console.log("clicked the input"); } Neither of which works. Question: How do I get a callback function to run when I'm triggering a click on an element?
Tags (comma-separated)
Save Edits
Cancel