<!DOCTYPE html>
<html>
<head>
<title>Practice with condition statements.</title>
<script LANGUAGE="Javascript" type="text/javascript">
function myFunction()
{
if (document.getElementById(input1).value == John);
{
alert("This is correct!");
}
else
}
alert("This is incorrect!");
}
}
</script>
</head>
<body bgcolor="green">
Answer:<input type="text" name="answer" id="input1">
<button type="button" onclick="myFunction()">Submit</button>
</body>
</html>
この関数がアラートメッセージを表示しない理由を一生理解できません。私は少なくとも1時間半それをいじりました、そしてそれは私に頭痛を与えています。これが私の目を逃してきた簡単な修正ではないことを願っています。私はこれがとても新しいので、どんな批判にも優しくしてください。:C