I’m trying to link my JavaScript to my HTML. I feel like I’m doing everything right but it’s returning this error message:
Index.html:1 Unchecked runtime.lastError: The message port closed before a response was received.
Can you see any problems with my HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<script src="button.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TagLine</title>
<link rel="stylesheet" href="Reset.css">
<link rel="stylesheet" href="Main.css">
</head>
<body>
<!-- Header including logo and document title: -->
<header id="main-header">
<img alt="Tagline Logo" src="ImagesTagLineLogo.png" class="logo">
<form>
<input type="text" name="title" value="title" id="title-input">
</form>
</header>
<!--TOOLBAR:-->
<!--Toolbar section 1 begin-->
<section id="toolbar">
<button class="defaultButton"></button>
<button class="defaultButton"></button>
<button class="defaultButton"></button>
<button class="defaultButton"></button>
<!--Toolbar section 1 end-->
</section>
</body>
</html>
Additionally, if I write something like this in my JavaScript file,
let html = document.querySelector("main-header");
The different words are white instead of the colors they should be in the editor
New contributor
Jack McGrath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4