Online Square Root Calculator by javaScript, Square Root Calculator Using javaScript, Square Root Calculator Tool with javaScript, Create Square Root Calculator in javaScript
Hello friends, today I will tell you through this tutorial how to create a Online Square Root Calculator by javascript code.
Step 1:- First Create html file (square-root-calculator.html).
Step 2:- Add Square Root JavaScript Code.
square-root-calculator.html
<html> <title> Square Root Calculator in JavaScript</title> <head> <script type="text/javascript"> function doMath(){ var inputNum1=document.form1.input1.value; var result = Math.sqrt(inputNum1); document.form1.answer.value = result; } </script> </head> <body> <form name=form1> Enter Number: <input type="text" name="input1" size=10> <input type="button" value="Calculate" onClick='doMath()'> <br> The square root is: <input type="text" name="answer" size=20> </form> </body> </html>