Im pretty new to JS and HTML (started ~20 hours ago) and already have a problem: below you can see my code. As one tutorial said, clicking on button will change the statusLine text. But something went wrong and i cant figure it out.
<!DOCTYPE html>
<html>
<head>
<title>Некое подземелье</title>
</head>
<body>
<p id="statusLine">Вы попали в подземелье.</p>
<button type="button" onclick="goDeeper()">Идти глубже в подземелье</button>
<script>
function goDeeper()
{
var nextEvent=(Math.floor(Math.random()*10+1));
switch(nextEvent){
case'1':
document.getElementById("statusLine").innerHTML="Вам на пути попался гоблин!";
break;
}
}
</script>
</body>
</html>
So, something is wrong. What should i do in order to fix this?
nextEventis not'1'