<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<H1 id="H1"></H1>
<input type="button" id="button1" onclick="CalculateSquare()" value="Click Me">
<script>
    function CalculateSquare()
    {
        var userInput;
        userInput = prompt("Enter a Number",10);
        if(userInput=="" || userInput == null)
        {
            document.getElementById("H1").innerHTML="Enter a Valid Value";
        }
        if(isNaN(userInput))
        {
            document.getElementById("H1").innerHTML="Enter a Number Value only";
        }
        else
        {
        document.getElementById("H1").innerHTML=userInput*userInput;
        }
    }
</script>
</body>
</html>