<!DOCTYPE html>
<html>
<head>
 <title>三大流程</title>
</head>
<script type="text/javascript">
 
/*1、单分支
 基本语法
 */

/*2、多分支
 基本语法
 if(条件语法1){
  //执行
 }
 else{
  执行
 }
*/
if(sex=="男"){
 window.alert("上男厕所")
}else if(sex=="女"){
window.alert("上女厕所")
}else{
 window.alert("不上厕所!")
}
//swich
swich(表达式){
 case 常量1:
 //执行语句
 break;
 case 常量2:
 //执行语句
 break;
 case 常量3:
 //执行语句
 break;
 ...
 default
 //执行
}
</script>
<body>
</body>
</html>