这是我的一段代码,它没有按预期的方式工作。可以告诉我我有什么问题
<html>
<body>
<form>
<input type="submit" value="Check" onclick="f(x, y, z)"/>
</form>
</body>
<script type="text/javascript">
var x = prompt("Enter the number","");
var y = prompt("Enter the number","");
var z = prompt("Enter the number","");
function f(x, y, z)
{
// first, check that the right # of arguments were passed.
if (f.arguments.length != 3) {
alert("function f called with " + f.arguments.length +
"arguments, but it expects 3 arguments.");
return null;
}
}
</script>
</html>