<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> if...else if... if </title>
<script type="text/javascript">
var answer = window.prompt ("去还是不去?建议输入yes,不建议输入no");
if (answer === "yes")
{
//嵌套
var fen = window.prompt ("请输入数字");
if (fen>90)
{
window.alert ("脚踩七彩祥云");
}else{
window.alert ("万众瞩目");
}
}else if (answer === "no")
{
window.alert ("改变不大");
}else
{
window.alert ("看一看世界的繁华");
}
</script>
</head>
<body>
</body>
</html>
j1.png
网友评论