alert.html
<DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<script src="alert.js"></script>
<body>
<input type="button" value="CLICK" onclick="myFunction();"/>
</body>
</html>
alert.js
function myFunction() {
alert("alert!")
}