javascript - I want to count how many questions are attended by user -


i want count how many question user attended. if user click 1 options 1 question want increment 1 value. ex: if user attend 7/10 count 7.

<div id="ques1" class="showquestion">     <div class="ques">         <p>questions ////////////</p>     </div>     <div>         a)         <input id="op-1-0" name="answers19" value="2918" type="radio" />     </div>     <div>         b)         <input id="op-1-1" name="answers19" value="2919" type="radio" />     </div>     <div>         c)         <input id="op-1-2" name="answers19" value="2920" type="radio" />     </div>     <div>         b)         <input id="op-1-3" name="answers19" value="2921" type="radio" />     </div> </div> <div id="ques2" class="showquestion">     <div class="ques">         <p>questions ////////////</p>     </div>     <div>         a)         <input id="op-1-0" name="answers19" value="2918" type="radio" />     </div>     <div>         b)         <input id="op-1-1" name="answers19" value="2919" type="radio" />     </div>     <div>         c)         <input id="op-1-2" name="answers19" value="2920" type="radio" />     </div>     <div>         b)         <input id="op-1-3" name="answers19" value="2921" type="radio" />     </div> </div> <div class="button-group">     <input value="previous" type="button" />     <input value="next" type="button" /> </div> <br/> <div id="count"></div> 

here answer: (jquery)

  var total = $(':radio:checked').length; 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -