首页 > 代码库 > JavaScript-switch-case-电话系统
JavaScript-switch-case-电话系统
1 <!DOCTYPE html> 2 <html> 3 <head lang="en"> 4 <meta charset="UTF-8"> 5 <title></title> 6 </head> 7 <body> 8 <script> 9 var tel=parseInt(prompt("====欢迎使用电话银行====\n"+"查询请按1\n"+"取款请按2\n"+"转账请按3\n"+"退出请按0\n")); 10 switch(tel){ 11 case 0: 12 console.log("退出.........."); 13 break; 14 case 1: 15 console.log("余额查询中...."); 16 break; 17 case 2: 18 console.log("取款进行中...."); 19 break; 20 case 3: 21 console.log("转账进行中...."); 22 break; 23 default : 24 cosole.log("你的输入有误..."); 25 break; 26 } 27 </script> 28 </body> 29 </html>
JavaScript-switch-case-电话系统
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。