Javascript quiz not working!!!?

Giridhar

New member
Joined
Nov 23, 2012
Messages
0
Reaction score
0
Points
0
<html>
<head><title>Quiz</title>
</head>

<body>

<form name="form">
What is the difference between haha and hehe?

<input type="radio" value="1" onclick="answer(this);" />2 E's
<input type="radio" value="2" onclick="answer(this);" />2 A's
<input type="radio" value="3" onclick="answer(this);" />2 A's and 2 E's



What is hahaha?

<input type="radio" value="1" onclick="answer1(this);" />LOL
<input type="radio" value="2" onclick="answer1(this);" />LMAO
<input type="radio" value="3" onclick="answer1(this);" />NOT
<br>
<input type="button" value="Click me" onClick="hello()">

</form>

<script>

var score=0;

function hello(){

function answer(selected){
if (selected.value="3"){
score+=1;}
}
function answer1(selected){
if(selected.value="1"){
score+=1;
}
}
alert("You scored "+score)
self.close()
}


What is wrong with this.....
It does not alert when i click the button..
Please explain...
 
Back
Top