Need help with my rock paper scissors game

Can you guys please help me because I can’t think of way on how to write the right code?

My goal is when I pick rock, paper, or scissors, the left side will output what is my choice, for example, I will pick rock then a word rock would show in the box, and on the right side, if the computer will pick paper then a word paper will show in the div box.

I am not that familiar with javascript only basic knowledge. It would mean a lot if you guys could help me with this problem and give some advice.

Here is my code:
https://codepen.io/david-lacsao/pen/eYdeVze

First of all, this line will cause an error:

messageDiv.appendChild(messageDiv);

You can just safely delete it, you don’t need to append the messageDiv to anything in the DOM because it’s already there. You only want to change its innerHTML (which you’re doing correctly in the line above).

To show your pick and the computer’s pick, you’ll have to do something similar, like

humanDiv.innerHTML = '<h2>'+ yourPick +'</h2>';
1 Like

@jsdisco wow thanks, man. Been solving this for a couple of hours, couldn’t believe the solution would be so simple. Merry Christmas :slightly_smiling_face:

did you submitted the previous projects? if so, could you help me, how do i get the url for submitting my project?

Merry Christmas to you to :love_you_gesture:

I must admit I’ve never submitted a project to fCC, but I think all you have to do is enter the URL to your codepen (should be “https://codepen.io/david-lacsao/pen/eYdeVze” for this project) into the input field in the challenge description (the one labelled “Solution Link”) and click on “I’ve completed this challenge”.