<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
 </head>
 <body>
  <script>
		var input = prompt("欢迎来到中国移动\n1、查话费请按1\n2、了解宽带请按2\n3、For English press 3\n4、人工服务请按 0");
		switch(input){
			case "1":
				alert("话费查询中,请稍后...");
				break;
			case "2":
				alert("宽带业务尚未开通...");
				break;
			case "3":
				alert("Sorry,我不懂英语...");
				break;
			case "0":
				alert("人工坐席忙,请稍后...");
				break;
			default:
				alert("输入有误!!!");
		}
	</script>
 </body>
</html>

JS-switch-case-根据输入的数字进入对应的文本

相关文章:

  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-08
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-12-13
  • 2021-12-25
相关资源
相似解决方案