Question 42 of 10042%
42
These files are served from the same directory by a local HTTP server. Which script tag should replace the comment in index.html so main.js can use its static import and display Hello, Ada!?
<!-- index.html -->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Module example</title>
<!-- Add the script tag here -->
</head>
<body>
<p id="message"></p>
</body>
</html>
// greetings.js
export function greet(name) {
return `Hello, ${name}!`;
}
// main.js
import { greet } from "./greetings.js";
document.getElementById("message").textContent = greet("Ada");
42/100