if else語句調(diào)用
文章導(dǎo)讀:
<html>
<head>
<title>if else語句</title>
</head>
<body>
<script language="javascript">
var name="Administrator";
if(name!="Administrator"){
document.write("<font color='blue'>"+name+"</font>");
//輸出藍(lán)色的name
}
else{
document.write("<font color='red'>"+name+"</font>");
//輸出紅色的name
}
</script>
</body>
</html>