var a="输出1" var b="输出2" var d="输出3" if(5>4){ document.write(a+"<br>") } if(4>4){ document.write(a+"<br>") } else document.write(b+"<br>") var c=4 if (c>5){ document.write(a+"<br>") } else if(c==4){ document.write(b+"<br>") } else{ document.write(d+"<br>") } if(a=="输出1"){ if(b=="输出2"){ document.write(d+"<br>") } }