Javascript examples for Math:SQRT2
The SQRT2 property returns the square root of 2, approximately 1.414.
A Number, representing the square root of 2
The following code shows how to return the square root of 2:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w ww .j ava 2 s.c om*/ document.getElementById("demo").innerHTML = Math.SQRT2; } </script> </body> </html>