First Getting The Value Then Getting Undefined Right After

Hello all,

I am trying to add a string to a certain element as innerText using JS DOM. But i can’t. When i console.log() the current value of the element, it first gives the current element text which is as expected but right after it gives undefined. I do not know why. Any opinions?

My goal is to state the winner to user. I am trying to do that on line 63-66-69 of JS.

You can find the code here → https://codepen.io/BGB37/pen/JjaQBvj?editors=0010

Are you still having trouble? I am unable to replicate the problem you describe with the pen you linked.

Hi @RandellDawson ,
I solved it i guess. I was trying to assing a value using İnnerText instead of innerText. After i corrected the typo everthing is working as expected.

Thank you for you time and interest.