Math.SQRT2 : SQRT2 : Math JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Math » SQRT2 »

 

Math.SQRT2








The SQRT2 property returns the value of the square root of 2.

This is approximately equal to 1.414.












<html>
    <body>
    <script language="JavaScript">
    <!--
    function doMath(){
        var result = Math.SQRT2;
        document.form1.answer.value = result;
    }
    -->
    </script>
    <form name=form1>
    The square root of is:
    <input type="text" name="answer" size=20>
    <input type="button" value="Calculate" onClick='doMath()'>
    <br>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Math
» SQRT2