我无法执行此代码。我已经尝试了很多次,但是仍然没有成功。
<html>
<head><title>
alvin</title>
<script type = "text/javascript">
var voting age = window.prompt("please enter your age");
if(voting age>=18)
{
document.write("you are eligible to vote");
}
else
{
document.write("you are not eligible to vote");
}
</script>
</head>
</html>
冷静的孩子不会在考试中紧张紧张,您唯一需要知道的是变量不能有空间,所以我只voting age
用voting_age
<html>
<head><title>
alvin</title>
<script type = "text/javascript">
var voting_age = window.prompt("please enter your age");
if(voting_age>=18)
{
document.write("you are eligible to vote");
}
else
{
document.write("you are not eligible to vote");
}
</script>
</head>
</html>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句