Please help asap with code!
for some reason, my code does no submit the amount of answers or highlight the correct answers once submitted.
code:
<html>
<head>
<script = "javascript">
document.write('<center><b><font color="#0000FF" font size=18>Binary Quiz</font></b></center>');
document.write("<br clear=all>");
document.write('This quiz is for those with the basic knowledge of Binary numbers, have fun and enjoy!');
document.write("<br clear=all>");
function show_alert()
{
alert("Think - binary, convert decimal numbers into binary first if it helps, for example, 1=?, 2=?, 3=0011");
}
</script>
<script type="text/javascript">
function myResult(){
correctanswers = 0;
if (document.myForm.q1[0].checked) correctanswers++;
if (document.myForm.q2[1].checked) correctanswers++;
document.getElementById("correct1").style.backgroundColor="red";
document.getElementById("correct2").style.backgroundColor="red";
return correctanswers;
}
function showResult(){
clearInterval(clockId);
correctAnswers2 = myResult();
alert("You have answered" + correctAnswers2 + " answers correctly!");
}
</script>
</head>
<body>
<input type="button" onclick="show_alert()" value="Hint" />
<form name="myForm" action="">
<center>
<p>
<IMG SRC=Game\0.jpg><IMG SRC=Game\0.jpg><IMG SRC=Game\0.jpg><IMG SRC=Game\1.jpg><br />
<input type="radio" name="q1" /> -1 <br />
<input type="radio" name="q1" /> 0 <br />
<input type="radio" name="q1" id="correct1"/> 1 <br />
<input type="radio" name="q1" /> 2 <br />
</p>
<p>
<IMG SRC=Game\0.jpg><IMG SRC=Game\1.jpg><IMG SRC=Game\0.jpg><IMG SRC=Game\1.jpg><br />
<input type="radio" name="q2" id="correct2"/> 5 <br />
<input type="radio" name="q2" /> 8 <br />
<input type="radio" name="q2" /> 9 <br />
<input type="radio" name="q2" /> 4 <br />
</p>
<p>
<input type="submit" name="submit" value="submit" onClick = "showResult()" />
</p>
</form>
</body>
</html>
PLEASEEE HELP!
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
Forum Rules
Bookmarks