I'm trying to retun the button i pressed i can console.log it but it can't return
const playerSelect = () => {
RPS = document.querySelectorAll(".rpsButton")
RPS.forEach(i => {
i.onclick = () => {
return i.value
}
})
}
return it to here and get comparison
const compare = (playerChoise()) =>
{
if (getComputerChoice() == "rock" && playerChoise == "paper")
{
score++
}
}
<div class="buttons">
<button class="rpsButton" value="Rock">✊</button>
<button class="rpsButton" value="Paper"></button>
<button class="rpsButton" value="Scissors">✌</button>
</div>