html link run javascript code example
Example 1: link javascript to html
<script src="index.js"> </script>
Example 2: how to make a html link execute a javascript function
<a href="javascript:alert('Hello!');">Clicky</a>
<script src="index.js"> </script>
<a href="javascript:alert('Hello!');">Clicky</a>