I have something like this :
div style='cursor: pointer;' onClick='myFunction(" . $_SESSION['pseudos'][$key] . ")'
that is supposed to enable users input while the game (in js) is playing. The user is supposed to clic on 1 out of X how those div to chose which char to kill. However the js doesn't stop and wait for an input. Any idea ?
My function js looks like this :
function myFunction(foo) {
    if (foo === null){
    document.getElementById("button").addEventListener("click", function() {
        foo = myFunction();
    }
    return foo;
}
 
     
    