var group1 =  $('input[name=group1]:checked').attr("value");
var group2 =  $('input[name=group2]:checked').attr("value");
var group3 =  $('input[name=group3]:checked').attr("value");

This will grab the value of the selected radio button within each of
your groups.

Then do some math to add up your variables.

so,
var result = (group1+group2+group3);
console.log(result);  // this will show the result of the variable in
firebug. If you are that much of a newbie, embrace firebug. learn to
love it and harness it's power.








On Jul 27, 3:41 pm, briggs81 <brigg...@gmail.com> wrote:
> This is probably simple, but I am new to jQuery and am trying to wrap
> my head around things.
>
> Basically what I am trying to do is a very basic quiz. I have 3 groups
> of radio buttons (3 questions with 4 possible answers for each
> question, so.. multiple choice).
>
> Each answer has a number value assigned to it, i.e. value="2". This
> would be 2 points.
>
> After pressing a button I need to be able to select all the radio
> buttons have that been checked, and then add all their point values up
> and give the user a score.
>
> Any hints would be appreciated.

Reply via email to