daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Dec 13th, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getScore(){
  2.   var answers = ["A", "A", "A", "A", "A"] // poprawne odpowiedzi pytania 1-5
  3.  
  4.   var correctAnswers = 0;
  5.   for(var i = 0; i < answers.length; i++){
  6.       var a = document.querySelectorAll("input[name=radio"+(i+1)+"]:checked").value;
  7.       if(a == answers[i]){
  8.         correctAnswers++;
  9.       }
  10.   }
  11.  
  12.   document.getElementById("result").innerHTML = correctAnswers;
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top