Javascript examples for Math:PI
The PI property returns the PI value, approximately 3.14
A Number, representing PI
The following code shows how to return PI:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from ww w.j a v a2 s . c o m*/ document.getElementById("demo").innerHTML = Math.PI; } </script> </body> </html>