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>
          function Square()
              var a=prompt("enter a number:");
              document.write("square of "+a+" is:"+(a*a));
            <input type="button" value="Square" onclick="Square()">
Run now

Input has taken through javascript prompt method


enter a number:5
square of 5 is:25