xxxxxxxxxx
<!DOCTYPE html>
<html>
<body>
<p>该实例调用函数并输出 PI 值:</p>
<p id="demo"></p>
<script>
function myFunction() {
return Math.PI;
}
document.getElementById("demo").innerHTML = myFunction();
</script>
</body>
</html>