I am building a small quiz app and the choices are all list items (li)

In jQuery or javascript how would I be able to allow the user to select one answer (it is ok if I need to add an 'a' tag) and then when they click submit (which can be done via javascript or jquery) the value is submitted with it. Also when the user clicks an option; where would I put the jquery code to manipulate the css.

Sample Code:

<li id="q1" value="1">Option 1</li>
<li id="q2" value="2">Option 2</li>
<li id="q3" value="3">Option 3</li>

Thanks in advance. If I sound a bit confusing or you can't figure out what I'm trying to say please comment and I'll try to clarify.

Member Avatar for stbuchok

Why aren't you using a radio button? That's kind of what they're for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.