www.webdeveloper.com
Results 1 to 2 of 2

Thread: Need help, JS.html file isn't working right

  1. #1
    Join Date
    Apr 2012
    Posts
    2

    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>


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

  2. #2
    Join Date
    Apr 2012
    Posts
    2
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles