Reply
Sat 5 Nov, 2011 01:48 pm
I am trying to get my prompt to work, and it is not happening, please help.
<html>
<head>
<title>Calculator</title>
</head>
<body>
<center> <h1> Calculator</h1>
<script language="JavaScript">
var num1
var sqnum;
num1 = prompt("What is your favorite number");
sqnum = Square(num1);
document.write( "The square root of" + num1 + "is" sqnum);
function Square(x)
{
var sq = x * x;
return sq;
}
</script>
</center>
</body>
</html>