How can I stop this function with the result?
I have code: <html> <h1>JavaScript Test</h1> <form name="quiz" id="quiz"> <div class="question">1. Jaki ciąg znaków jest używany do definiowania zmiennych?</div> <input id="answer" type="radio" name="group1" value="wrong">int<br> <input id="answer" type="radio" name="group1" value="correct">var<br> <input id="answer" type="radio" name="group1" value="wrong">vrb<br> <input id="answer" type="radio" name="group1" value="wrong">variable<hr> <div class="question">2. Jak jest nazywany "=" (znak równości) w JS?</div> <input id="answer" type="radio" name="group2" value="wrong">jest równoważne<br> <input id="answer" type="radio" name="group2" value="wrong">równy<br> <input id="answer" type="radio" name="group2" value="correct">jest to operator przypisania<hr> <script> var result = document.querySelector('#result'); var button = document.querySelector('button'); button.addEventListener('click', function() { var correct = 0; for(var i = 1; i <= 4; i++) { var radios = document.getElementsByName('group' + i); for (var j = 0; j < radios.length; j++) { var radio = radios[j]; if(radio.value == "correct" && radio.checked) { correct ++; } } } result.innerHTML = "Poprawne odpowiedzi: " + correct; break; }, false); The 'result' are moments displayed and disappears :/ How can I stop this function with result???