<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>函数</title>
<script type="text/javascript">
function cond(x,y){
if(x>y)
{
return x;
}
else if(x<y)
{
return y;
}else
{return "两数相等"}
}
document.write("5和6的较大值:"+cond(5,6)+"<br/>");
document.write("6和4的较大值:"+cond(6,4)+"<br/>");
document.write("55和55的较大值:"cond(55,55));
</script>
</head>
<body>
</body>
</html>
两数相等后面没有";"分号,"55和55的较大值:"+cond(55,55),我也初学,就看到这,你改的试试?
document.write("55和55的较大值:"+cond(55,55));
不过建议 var sum1= cond(55,55);
"55和55的较大值:"后面少了个加号吧?