const players = {
player1: {
attack: 5,
defense: 3,
speed: 5,
control: 5,
strike: 5,
stateOnSat: false
},
player2: {
attack: 3,
defense: 5,
speed: 4,
control: 4,
strike: 5,
stateOnSat: false
}
}
const btnPlus = document.querySelectorAll('.btn-plus')
btnPlus[0].onclick = () => {
players.player1.stateOnSat = true
alert(players.player1.stateOnSat) // true
}
// Или
btnPlus[1].addEventListener('click', () => {
players.player2.stateOnSat = true
})
Или
<button class="fas fa-plus-square btn btn-plus" onclick="players.player2.stateOnSat = true">Plus</button>