this is what I tried So I am trying to disable the options buttons in my quiz app after the user selects a option.
I am doing this because when the correct option is shown after the user selects any option if I click the correct answer again the score counter increases and also if the user selects the wrong answer and then if he selects the correct answer then he can continue the game.
This is the quiz game check it out and see the prob=> https://coderjm1.github.io/guessthisflag.github.io/
HTML
<div id="answer-buttons" class="btn-grid">
<button class="btn" onclick="disable()">Answer1</button>
<button class="btn" onclick="disable()">Answer2</button>
<button class="btn" onclick="disable()">Answer3</button>
<button class="btn" onclick="disable()">Answer4</button>
</div>
JAVASCRIPT
function disable() {
let elems = document.getElementsByClassName('btn')
for(let i = 0; i < elems.length; i++){
elems[i].disable = true;
}
}