Marcela Bahamón
PreguntaA pesar de que puse el script antes del cierre del body, solo me carga el fondo azul antes de la alerta. No sale el texto. ¿Saben qué puede ser? ¿Es normal?
Este es el código:
<html>
<head>
<title> Mi primer archivo HTML. </title>
<style>
body
{
background-color: #4fdcf2;
color: white;
font-family: Helvetica;
}
strong
{
background-color: #e9a8ff;
}
</style>
</head>
<body>
<p> Hola mamá, <strong>ya casi</strong> aprendo. </p>
<p> Este es otro párrafo </p>
<script>
alert(“Mensaje especial con alerta”);
</script>
</body>
</html>
Gabriel Murillo
el body tiene un error
Ariel Omar Carrión Alcocer
tambien me pasa

Eddy Arellanes
Hola!
Bueno revisando la documentación de la función alert en
https://developer.mozilla.org/en-US/docs/Web/API/Window/alert
Mencionan esto:
“Dialog boxes are modal windows - they prevent the user from accessing the rest of the program’s interface until the dialog box is closed. For this reason, you should not overuse any function that creates a dialog box (or modal window).”
A recomendación, te diría que uses alerts únicamente cuando se dispare un evento, por ejemplo on click, change, etc.
Así podrás evitar tu problema 😃