Save file as: Save file The onclick event is used to trigger a function when an element is clicked on. To call a function inside an external file, make sure the file is loaded first and then call it as per normal (so long as it exposes itself to the scope you need it to). share | . onClick can't redirect you to another espn1600am.com is not designed that way. All you have to do is include espn1600am.com file in the header section in html document.