0

I have been reading up on this error on this forum but am not finding anything that is helping. The really odd thing is that I copied this from my instructor in a lecture but it will not run past the . Any ideas?

<!DOCTYPE html> 
    <html> 
    <head>
     <meta charset="UTF-8">
    <title>Warner: iLab 1  Iteration and Summing Numbers</title>
    </head>
    <body style="font: 100% Ariel;">
    <h2>Iteration |Summing Numbers Between Two Integers |</h2><hr />
    <p>
       <script type="text/javascript">  

         var firstInt = parseInt(prompt("Enter an Integer from 1 and 4",""));
         document.write("Your first Entry: " +firstInt);
         var secondInt = parseInt(prompt("Enter an Integer from 6 and 9",""));
         document.write("<br> Your second Entry: "+secondInt+"<br>);
         var  sumNumbers = 0;
         for(var i=firstInt;  i<=secondInt;  i++)
         {
            sumNumbers += i;
         }
         document.write("<br>The answer is "+ sumNumbers);

       </script>
    </p>
    </body>
    </html>
floyd
  • 111
  • 1
  • 1
  • 10
  • 1
    Read through [this post](http://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice) about `document.write` - generally you'll want to avoid doing that. – Joe Enos Jul 08 '14 at 06:17
  • Thanks for the tip...I'm just doing it how the instructor wants this done. I will definitely check this post out though. – floyd Jul 08 '14 at 06:20
  • The font name is "Arial." "Ariel" might not do what you expect. – David Ehrmann Jul 08 '14 at 06:27

3 Answers3

1

You're missing your closing quotation mark:

document.write("<br> Your second Entry: "+secondInt+"<br>);
Joe Enos
  • 36,707
  • 11
  • 72
  • 128
  • If you're using a decent editor with syntax highlighting, the missing quote would be pretty obvious. I'd recommend finding a good editor - there are plenty of free ones. – Joe Enos Jul 08 '14 at 06:19
0

You are missing a quotes here:

 document.write("<br> Your second Entry: "+secondInt+"<br>);

Should be:

 document.write("<br> Your second Entry: "+secondInt+"<br>");

Hope this helps.

link
  • 2,272
  • 1
  • 12
  • 17
0

You should close your double quote 4th line of script.

document.write("<br> Your second Entry: "+secondInt+"<br>");
Mritunjay
  • 22,738
  • 6
  • 47
  • 66