I'm pn a restricted network at the moment so I cant look at the page source, but my guess is that this is your problem:
getElementsByClassName('balls')
You need to specify which attribute of which element you want, you're returning an array of html elements there and trying to put them somewhere that requires a text object. Could you not use getElementById() ?
If not,
document.getElementsByClassName('gameContent')[0].getElementsByClassName('balls')[0].getAttribute('textContent')
My knowledge of JS is limited, but I imagine this should work.