I have multiple javascript functions in my html page. One of them, by far the biggest, is executed on a button click. If I moved that function into a separate .js file, what would be the syntax to have the onclick run that file?
Just make sure the script file is loaded before you try to use the functions defined within it. With jquery, for example, you'd wrap your calling code within a $(function () { /* here */ });.
If the name of the function is still the same, then you don't have to do anything except include the script in your html somewhere before any code uses it, like so:
Your onclick doesn't run the file. It runs the function contained within that file. You wouldn't need to change the onclick syntax to make that happen.
$(function () { /* here */ });.