猿问

求助请帮我看一下这个代码哪里有错,打开出来什么都没有,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
   <title>Title</title>
   <meta http-equiv="Content-Type" content="text/html";charst="utf-8" />
   <script type="text/javascript">
   function choices() {
       var prefchoice = 1;
       var statechoice = 'OR';
       var genderchoice = 'F';
       if (prefchoice === 1) {
           alert("You've picked option 1.Here is what will happen...");
           if (statechoice === 'OR') {
               alert("You've picked 1 and you're from Oregon.");
               if (prefchoice === 'M') {
                   alert("You've picked i and you're from Orgon and you're a man.");
               }
           }
       }
   }
   </script>
   </head>
<body onload="choices">

</body>
</html>


sgbb88
浏览 1303回答 2
2回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答