Esta es la estructura de mi pagina HTML pero no ejecuta los scripts, que puede ser? Disculpen si se ve desorganizado. Probé en otro HTML que tengo como pruebas y el script funciona normalmente, no se que pudo haber pasado en el HTML principal.
<!DOCTYPE html>
<html>
<BODY LANG="en-US" BGCOLOR="#000000" DIR="LTR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Titulo de la pagina</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="container">
<header><h1 ALIGN=CENTER><FONT COLOR="#ff0000">Header</FONT></h1>
</header>
<center><a href="lab.html"><img src="inicio.jpg" onmouseover="this.src='inicio.jpg'" onmouseout="this.src='inicio.jpg"/></a></center>
<hr color="#0080FF">
<FONT COLOR="#ff0000">¿Qué es?</FONT></font></h2>
<p><font color = "#2E7429">texto1</font></p>
<p><font color = "#2E7429">texto2</font></p> <h2><font color="FEFEFE"></font></h2>
<h2><FONT COLOR="#ff0000">header2</font></h2>
<p><font color = "#2E7429">texto3</font></p>
<h2><FONT COLOR="#ff0000">header3</font></h2>
<p><font color = "#2E7429">texto4</font></p>
<h2><FONT COLOR="##2E7429">header4)</font></h2>
<br><br>
<font size="6"><FONT COLOR="#ff0000"><p><marquee>texto5</marquee></FONT>
</div>
</body>
</html>
<script src="screen.js"></script>
EDIT: Este es el Javascript:
var images = [
'Space.gif', 'Windows.gif'
]
setInterval(function() {
const image = images.shift()
document.querySelector('body').style.backgroundImage = `url(${image})`
images.push(image)
}, 3000);
EDIT 2: El Visual Studio Code me muestra el siguiente error: "Unterminated string literal." y viene de aquí:
<center><a href="lab.html"><img src="inicio.jpg" onmouseover="this.src='inicio.jpg'" onmouseout="this.src='inicio.jpg"/></a></center>
Ese pedazo de codigo como se puede ver son los botones de la pagina. Será que esa es la causa que no corra el script asi no tenga nada que ver con los botones de la pagina? Como puedo corregir esto?
Saludos!