JavaScript JavaScript Basics Hello, JavaScript! JavaScript Challenge Solution

I did everything right but nothing happened

My question is pretty self explanatory but I did everything and entered the exact code from the video and nothing happened except for the page saying boom. I fI could please get some help that would be awesome.

We can't help you without seeing your code.

Here is the code.

// 1. Display an alert dialog with the content: "Warning! This message will self-destruct in" alert("Warning! This message will self destruct in");

// 2. Display a "3... 2... 1..." countdown using 3 alert dialog boxes alert("3..."); alert("2..."); alert("1...");

// 3. This statement selects the <h1> element and replaces its text with "BOOM!". document.querySelector("h1").textContent = "🔥BOOM!🔥";

// 4. Log "Message destroyed!" to the console console.log("Message destroyed!");

Simon Safferson
Simon Safferson
4,150 Points

Hey! I think you might have posted the instructions by accident? :)

Whoops you're right. Here is the code.

alert("Warning! this message will self destruct in..."); alert("3..."); alert("2..."); alert("1..."); document.querySelector("h1").textContent = "🔥BOOM!🔥"; console.log("Message Destroyed");

3 Answers

ethan wolfe
ethan wolfe
3,817 Points

this might sound dumb, but did you save after writing the code? even if its open right in front of you it wont run the code without saving.

I did not actually. How do you save? Thanks for your response.

ethan wolfe
ethan wolfe
3,817 Points

On windows you can use the "ctrl" + "s" keys. Or in the workspace in the top left there should be a tab called "file" and it should have the save option in it.

Vaidehi S
Vaidehi S
4,278 Points

Hi,

I have the same issue, I even saved the code however it doesnt display the console.log() message in the console.