JavaScript program to find square of a number

In this program, the user will take input through the window prompt and find the square of a number in javascript.

<!DOCTYPE html>
<html>
    <body>
        <script>
          function Square()
          {
              var a=prompt("enter a number:");
              document.write("square of "+a+" is:"+(a*a));
	   }
        </script>
        <form>
            <input type="button" value="Square" onclick="Square()">
        </form>
    </body>
</html>
Run now

Input has taken through javascript prompt method

output

enter a number:5
square of 5 is:25