【发布时间】:2016-09-20 23:12:14
【问题描述】:
我想提醒“正在运行的大炮”,然后当我按下确定时,我只想说“大炮船航行到 14 度”,但它会继续在我的输出中打印警报。
JS
function alertMessage (message) {
alert (message);
}
alertMessage("the Battle has begun");
function alertShip (ship, number) {
alert (ship);
document.write (ship + "the ship sails off to " + number + "degrees");
}
alertShip("running function cannons", 14);
HTML
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Functions</title>
<!-- This links to the js code specific for this page -->
<script src="functions.js"></script>
</head>
<body>
<div id="output"> </div>
<div id="output2"> </div>
</body>
</html>
【问题讨论】:
-
不用document.write试试
标签: javascript function parameters output alert