anythursday
07-29-2005, 03:27 AM
I know I"m doing something wrong here because nothing will load on the screen. I'm a complete dumbass when it comes to javascript. I can only understand SIMPLE things and this has proved to be way too advanced for me.
Basically, I can't get my program to allow users to input both the number and i (which is the power of i). Being unable to do that, I can't get it to output anything either. Thank you in advance!
<html>
<body>
<script type="text/javascript">
var num, i;
num = myform.element [0].value;
i = myform.element [0].value;
function argument(num, i)
{
if( i == 0)
{
return 1;
}
var result;
result = Math.pow(num,i);
return result;
}
document.write (result);
</script>
</body>
</html>
Basically, I can't get my program to allow users to input both the number and i (which is the power of i). Being unable to do that, I can't get it to output anything either. Thank you in advance!
<html>
<body>
<script type="text/javascript">
var num, i;
num = myform.element [0].value;
i = myform.element [0].value;
function argument(num, i)
{
if( i == 0)
{
return 1;
}
var result;
result = Math.pow(num,i);
return result;
}
document.write (result);
</script>
</body>
</html>