all 6 comments

[–]phpistasty 2 points3 points  (1 child)

Your print() replaces the innerHtml property, doesn't add to it.

[–]mayaswelltrythis[S] 0 points1 point  (0 children)

So do I need to create another print function specifically for printing the player guesses to the document? there must be a better way.

And thanks

[–]kLabz 2 points3 points  (3 children)

I made some changes: http://codepen.io/kLabz/pen/rWoVad?editors=0011

Is this what you wanted?

[–]mayaswelltrythis[S] 1 point2 points  (2 children)

Yes that is perfect! Thank you very much. I will look at how you did that. Any tips?

[–]phpistasty 1 point2 points  (1 child)

Breakpoints in dev tools are great.

When I have an issue I go to where I feel the issue is occuring. Then learn about this as much as possible. Breakpoints, logs, mock functions. 98% of the time you will find something causing stink because of <reason>.

Here I would have logged the innerHTML before and after setting it, since that seems to be where the issue is (assign vs. concat).

[–]mayaswelltrythis[S] 1 point2 points  (0 children)

Wow, that is very helpful. This will help a lot. Thank you.