I'm making a program with 4 players.
Each player having a main button to trigger a main function and 3 more buttons, each blocking one of the 3 remaining players from performing the main function while triggering the same main function for the player pushing the button
When the blocked player pushes their main button it triggers a different function than the main one.
I have been able to make the main button and its functionality but not the effects of the block button.
Currently I'm putting this in my external js script for the blocked function:
if (document.getElementById("kelly-block-john").clicked == true){
document.getElementById("john-button").onclick = "johnBlocked()";
}
Does anybody have any idea on how to make the effects of the block buttons work?
Use Event Listener to check if the button is clicked and also to run a function when it is clicked. Find out the details and syntax here: https://www.w3schools.com/js/js_htmldom_eventlistener.asp