im having a problem with an accumulator on Javascript, im new onto this, so could anybody help me with this? i just want an accumulator for right answers this is my script because it just keeps giving me 0 as a result.
<script type="application/javascript">
var count=0;
function counter(){
count=count+1;
}
function results(){
alert ("The number of correct answers is "+count)
}
</script>
and this is the structure for my buttons
<input type="radio" name="p1" value="answ" onsubmit="counter()">
for correct answer
<input type="radio" name="p1" value="answ1">
for other options