Hello, I making flashcard app and I have a problem with this code:
const word1 = document.querySelector('#word1');
const bt = document.querySelector('#bt');
function rand(){
return Math.floor(Math.random() * 5);
}
word1.innerText = rand();
word2.innerText = rand();
bt.addEventListener("click", function(){
word1.innerText = rand();
word2.innerText = rand();
});
whole code
I want two numbers that I draw using the button to always be the same, how to do it?
the point is that in this code, the word that will appear after the “show” sticky has to agree. Sorry for my English if there are some issues. Thanks in advance for your answers.