/    Sign up×
Community /Pin to ProfileBookmark

Need help, JS.html file isn’t working right

for (i=0;i<=5;i++)
{
document.write(“The number is ” + i);
document.write(“<br />”);
}

[CODE]
<html>
<head>
<script type=”text/javascript”>
// Danny
// 4/17/2012
// Take 2 numbers from user, then gives the value of the first number to the power of the second number.
function exponent()
{
var Num1=ocument.getElementById(“num1”).value;
var Num2=ocument.getElementById(“num2”).value;
var Counter = 0;
for (Counter = 0;Counter != 5;Counter++)
{
Num1 = (Num1 * Num1);
}
alert(“The answer is: ” + Num1);
}

</script>
</head>
<body>

<input type=”number” name=”num1″>
<input type=”number” name=”num2″>
<input type=”button” onclick=”DannyByTwo()” value=”Start Danny’s Even Number Adder!” />

</body>
</html>

[/CODE]

I think I’m missing something simple, but I’ve been looking for almost an hour now and can’t find it.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@the_new_guyauthorApr 17.2012 — Please ignore the first part


for (i=0;i<=5;i++)

{

document.write("The number is " + i);

document.write("<br />");

}

I copied and pasted the wrong thing, when I was trying to copy in my code.

sorry
×

Success!

Help @the_new_guy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...