//假如变量为1 var idd=1; //switch匹配 switch (idd){ case 1: alert("你输入了1"); break; case 2: alert("你输入了2"); break; } 复制代码
//假如变量为1 var idd=1; //switch匹配 switch (idd){ case 1: alert("你输入了1"); break; case 2: alert("你输入了2"); break; }