close
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>index15-3</title>
<script type="text/javascript">
function Convert2F(DegreeC){ //宣告函式名稱Convert2F,參數為DegreeC的函式
var DegreeF = DegreeC * 1.8 + 32;
alert("攝氏" + DegreeC + "度等於華氏" + DegreeF + "度");
}
var DegreeC = prompt("請輸入攝氏溫度:");
Convert2F(DegreeC); //呼叫函式Convert2F,並將接收到的DegreeC作為參數傳入
</script>
</head>
<body>
</body>
</html>
全站熱搜
留言列表