有几个问题
//document.write(x y z"和:"+sum+"<br/>"); 为什么要用 x+,+y+???
document.write(x+"、"+y+"、"+z+"和:"+sum+"<br/>");
}
//document.write(add3(5,8,3)); 为什么重复document.write 会报undefined?
//document.write(add3(7,1,4));
add3(5,8,3);
add3(7,1,4);
//document.write(x y z"和:"+sum+"<br/>"); 为什么要用 x+,+y+???
document.write(x+"、"+y+"、"+z+"和:"+sum+"<br/>");
}
//document.write(add3(5,8,3)); 为什么重复document.write 会报undefined?
//document.write(add3(7,1,4));
add3(5,8,3);
add3(7,1,4);
2016-01-01
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>函数传参</title>
<script type="text/JavaScript">
function add3(x,y,z)
{
sum = x + y +z;
//document.write(x y z"和:"+sum+"<br/>");
document.write(x+"、"+y+"、"+z+"和:"+sum+"<br/>");
}
//document.write(add3(5,8,3));
//document.write(add3(7,1,4));
add3(5,8,3);
add3(7,1,4);
</script>
</head>
<body>
</body>
</html>
举报