Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAdam N
70,280 PointsDo you want to make it different than how Guil wants it to be? It looks like your code follows the sequence that it's supposed to.
2 Answers
eodell
26,386 PointsHi. Do you mean like this:
<!DOCTYPE html>
<html>
<head> <meta charset="utf-8">
<title>JavaScript Basics – Challenge</title>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<main>
<h1>Hello, JavaScript!</h1>
<script>alert("Warning! This message will self-destruct in");</script>
<script>alert("1....")</script>
<script>alert("2....")</script>
<script>alert("3....")</script>
</main>
<script src="js/script.js"></script>
<script>console.log("messege destroyed")</script>
You can type whatever order you want when the inner HTML is hardcoded, like in your example above.
kevin hudson
Courses Plus Student 11,987 Pointsyou can also write less code by looping (backward)
alert("Warning The message will self destruct in ");
for(let i = 3; i >= 1; i--){
alert(`${i}..`);
}
document.querySelector("h1").textContent = "🔥BOOM!🔥";
console.log("message destroyed!");
Jessica Hoang
1,243 PointsJust wondering, but within the for loop, why was alert written as "alert(`${i}..');" ? I understand 'i' is the value iteration variable, but I don't understand the rest of the Syntax. Thanks :)
sangdon jang
501 Pointssangdon jang
501 Points<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JavaScript Basics – Challenge</title> <link href="css/style.css" rel="stylesheet">
</head>
<body>
</body> </html>