For some unknown reason(console doesn't show it), it's not showing the response to the input like "the answer is right" or "the answer is either empty or wrong"
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello!</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- import the webpage's stylesheet -->
<link rel="stylesheet" href="/style.css">
<!-- import the webpage's javascript file -->
<script src="/script.js" defer></script>
</head>
<body>
<h1>Hi there!</h1>
<p id="check1">
The result will be shown here
</p>
<input type="text" id="word0" placeholder="enter what you heard " />
<script>
function check()
{
var arr=["cat","dog","fish","husky","jasmine"]
var answer1=document.getElementById("word0").value
if (answer1==arr[0] )
{document.getElementById("check1").innerHTML="The answer is right"}
else {document.getElementById("check1").innerHTML="The answer is either empty or wrong, please reenter"
var answercat=[]
answercat[0]=prompt("enter the word cat for the first time:")
if(answercat[0]!="cat")
{prompt("you entered wrong word, enter the word 'cat' one more time")}
answercat[1]=prompt("enter the word cat for the second time:")
if(answercat[1]!="cat")
{prompt("you entered wrong word, enter the word 'cat' one more time")}
answercat[2]=prompt("enter the word cat for the third time:")
if(answercat[2]!="cat")
{prompt("you entered wrong word, enter the word 'cat' one more time")}
answercat[3]=prompt("enter the word cat for the fourth time:")
if(answercat[3]!="cat")
{prompt("you entered wrong word, enter the word 'cat' one more time")}
answercat[4]=prompt("enter the word cat for the fifth time:")
if(answercat[4]!="cat")
{prompt("you entered wrong word, enter the word 'cat' one more time")}
}
}
</script>
<button onclick="check()">
</button>
<p>
I'm your cool new webpage. Made with <a href="https://glitch.com">Glitch</a>!
</p>
<!-- include the Glitch button to show what the webpage is about and
to make it easier for folks to view source and remix -->
<div class="glitchButton" style="position:fixed;top:20px;right:20px;"></div>
<script src="https://button.glitch.me/button.js"></script>
</body>
</html>
Thank you in advance!