如何在输出中使用换行符?里面有问题document.write
。
请检查我的代码并给我最好的解决方案..
<html>
<head>
<script type="text/javascript">
function FahToCent (degFah)
{
var degCent = new Array ();
for (var loopCounter = 0; loopCounter <=2; loopCounter++)
{
degCent[loopCounter] = 5/9 * (degFah[loopCounter] - 32);
}
return degCent;
}
</script>
</head>
<body>
<script type="text/javascript">
var degFah = new Array ();
for (var loopCounter = 0; loopCounter <= 2; loopCounter++)
{
degFah[loopCounter] = prompt ("Enter Temperature in Fahrenheit");
}
document.write (FahToCent (degFah)+"<br>");
</script>
</body>
</html>