<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<script src="script.js"></script>
</head>
<body>
<h1>Welcome to My Website</h1>
<p id="greeting"></p>
<button onclick="showGreeting()">Click me</button>
</body>
</html>
the HTML page includes a <script> tag in the <head> section that links to an external JavaScript file called "script.js". The HTML body includes a heading, a paragraph element with an id of "greeting", and a button that calls a JavaScript function called "showGreeting()" when clicked.
JavaScript file (script.js):
function showGreeting() {
var name = prompt("What's your name?");
if (name != null) {
var greeting = "Hello, " + name + "!";
document.getElementById("greeting").innerHTML = greeting;
}
}