Advertisement
MartinYanchev-99

js

Oct 13th, 2020
1,936
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  let btn = document.getElementById("btn-result");
  2.     let opt_1 = "{{exercise.opt_1}}"
  3.     btn.addEventListener("click",get_result)
  4.     function get_result(){
  5.     const form = document.forms.quiz
  6.     const radios = form.elements.name
  7.     const checked = Array
  8.                  .from(radios)
  9.                  .find(radio => radio.checked).value;
  10.     console.log(opt_1)
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement