Prev Demo
Square Root In Javascript
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to return Square root.</p> <input type="button" onclick="myNumber()" value="Click"> <p id="myId"></p> <script> function myNumber() { var a = Math.sqrt(4); var b = Math.sqrt(9); var c = Math.sqrt(16); var d = Math.sqrt(25); var e = Math.sqrt(36); var f = Math.sqrt(49); var g = Math.sqrt(64); var h = Math.sqrt(81); var r = a + "<br>" + b + "<br>" + c + "<br>" + d + "<br>" + e + "<br>" + f + "<br>" + g + "<br>" + h; document.getElementById("myId").innerHTML = r; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output