<!DOCTYPE html>
<html>
<body>
<p>本例调用函数将华氏温度转换为摄氏温度:</p>
<p id="demo"></p>
<script>
function toCelcius(f) {
return (5/9) * (f-32);
}
document.getElementById("demo").innerHTML = toCelcius(32);
</script>
</body>
</html>