The click button does not display the alert as required

What could be wrong with this code? The click button does not display the alert as required.
a). HTML:

<!doctype html>
<html>
 <head>
   <link rel="stylesheet" href="index.js">
 <title>Learning Javascript</title>

 <meta charset="utf-8" />
 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
 <meta name="viewport" content="width=device-width, initial-scale=1" />
 </head>

 <body>
  <button id="myButton" name="button">Click here for more!!</button>
</body>
</html>

b). JavaScript:

document.getElementById("myButton").onclick=function() {
  alert("Jambo!");
 }

Did I miss something?

I suggest you research how to properly reference an external JavaScript file. link elements are not for JavaScript. There is a special element for JavaScript though. See if you can figure it out via your own research.