How to trigger an action from a function?

I have a text field that targets an action on change but I also need to trigger that from a javascript function. How do you do that?