Trouble with event listener / manipulating DOM

Hi all,

The buttons are working in console.log, but I am having trouble getting the event listener to change the value of player.currentChoice to the corresponding index of the choices.

Thank you!

Checked you code , everything looks ok, and the value is changing, the other thing is that you probably should move computer choice and comparison function calls to event listeners and dont make players choice programmatically you’ll get it after click.
hope this helps :slight_smile:

Hi! Thanks for your help! Where do you see the value changing? I only see it displaying that the player chose choices[0], regardless of which button I click on. The console.log output is changing depending on which button I push, but not the choices value as displayed on the p element.

Hi :slight_smile:
I see its working now as expected , right?
you set userchoice at line 9,
player.currentChoice = choices[0];
and executed compare function as far as i remember