运行不出来?
<!DOCTYPE HTML>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>if语句</title>
<script type="text/JavaScript">
var mypen = "black"; //定义变量mypen,存储笔的黑色。
if(mypen=="black")
{
document.write("笔是黑色的,所以购买");
}else{
document.write("我再去找找看,谢谢!");
}
</script>
</head>
<body>
</body>
</html>