Alert doesn’t pass.
Instructions:
Step 3
If the messageInput
is empty, display an alert to the user with the message Please enter a message.
.
Then, exit the function execution.
My code:
checkMessageButton.addEventListener("click", () => {
if (messageInput.value === '') {
return alert('Please enter a message.')
}
});
Error message:
Sorry, your code does not pass. Try again.
Your if
statement should display an alert to the user with the message Please enter a message.
.
That doesn’t solve the problem, I have already tried it and here is the error message I got:
Sorry, your code does not pass. Keep trying.
Your if statement should exit the function execution.
ILM
4
can you provide the link to the step?
ILM
6
If the messageInput
is empty, display an alert to the user with the message Please enter a message.
.
You first write the alert
, then after the alert…
Then, exit the function execution.
after the alert you write the return
1 Like
system
Closed
8
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.