go to link js code example
Example 1: javascript go to url
window.location = url;
Example 2: how to link js to html
<script src="Your-JavaScript-File.js"></script> <!--If JS file is in same folder with HTML file-->
window.location = url;
<script src="Your-JavaScript-File.js"></script> <!--If JS file is in same folder with HTML file-->