Here's my code! I need help! I can't get the quiz to score when you click on the score button. CAN ANYONE HELP ME BY MONDAY DEC 2ND? The error codes say ( line 15 expected ; this is line 15--Var answers = newArray(3) and (line 66 object expected--this is line 66--<p><INPUT TYPE="button" VALUE="Score Quiz" onClick="scoreQuiz1();"></p>)--I'm stumped! I will be eternally grateful for help.
<html>
<HEAD>
<TITLE>Car Quiz</TITLE>
Var answers = newArray(3);
var correctAnswers = newArray(3);
correctAnswers[0] = "a";
correctAnswers[1] = "a";
correctAnswers[2] = "a";
function recordAnswer(question, answer) {
answers[question-1] = answer;
}
function scoreQuiz1() {
var totalCorrect = 0;
for (var count = 0; count < correctAnswers.length;++count){
if (answers[count] == correctAnswers[count]) ++totalCorrect;
}
alert("You scored " + totalCorrect + " out of 3 answers correctly!");
}
//stop hiding from incompatible browsers-->
</SCRIPT>
<body bgcolor="EOEOEO">
<center><H3>Take this quiz!</h3></center>
<p>Answer the following questions then click the "Score Quiz" button to grade your quiz.</p>
THANK YOU! THANK YOU! You really are the "master of the web"! I don't know why I had the script and body like they were. I closed the head and put the links in the body. THANK YOU for fixing the var for me. I changed a lot of things but not that particular item. I have spent hours on my site-which is a project for school and I need to walk away for awhile. Too much coding within a period of time I guess. I have one more page that has a problem. Using a form to register it should go automatically to the email address. I thought it would send it straight to my email and close the page or return home. It's probably something simple that I am just overlooking. Thanks again! (Do I need javaScript language on this page?)
<html>
<head>
<Title>Customer Information</title>
</head>
<A HREF= "much ado.html">Return home!</a>
<body BACKGROUND="Blue hills.jpg">
<h3>Register here for our newsletter!</h3>
E-mail address<br><p><input type="text" name="E-mail" Size=50></p>
<input type="reset"><br>Click here<input type="image" src="rabbit jumping.gif">and your registration will be on its way!
</body>
</html>
Sorry I wasn't clear! It seems to happen a lot to me when learning this JavaScript. When you fill out a registration form, should it go directly to an email account or open the email to fill in and send? I want--when you fill out the form and click send-- it sends the registration to my email. I guess I want it to send the registration form behind the scenes. When I click send now, it opens my email with the cursor in the subject line. And I don't know what is up with me the head/body tag issues! I'll fix that too but that doesn't change the way the program will run will it? Thanks...you are a godsend!
Bookmarks