我有这个代码:
<script language="javascript">
var noun=["cat","mat","rat"];
var verb=["like","is","see","sees"];
var object=["me","a+noun","the+noun"];
var subject=["I","a+noun","the+noun"];
var sentence=(subject+verb+object);
function checkCorrectness(){
var input=document.getElementbyId("userInput");
if(input==sentence)
{
alert("congratulations your sentence is correct");
}
else if(input=="null"||"")
{
alert("your entered a blank text, please enter sentence");
}
else{
alert("Sorry, Your sentence is incorrect, your sentence should be in the form of a subject, verb and object. please try again");
}
};
</script>
</head>
<body>
<h1><font size="3" color="black" face="comic sans ms">Welcome to Micro English</font></h1>
<h2><font size="2" color="blue" face="comic sans ms">Please Enter a sentence in micro English in the box below</font></h2>
<form onsubmit="checkCorrectness();">
<input type="text" name="input" id="userInput"/>
<input type="submit"value="go"/>
</form>
但是当我点击“开始”按钮时没有任何反应。可能是什么问题?我曾尝试更改输入的类型,但它从未运行过,我有一个类似的程序确实运行过,但我只是在这里解决了问题。请帮忙