0

So, the title makes this seem easier than it really is. I am developing a memory game for an online JavaScript course project which has some starter code to begin with.

I am trying to update the counter display in the HTML and have tried every possible method I know to do so but have been unsuccessful so far. The element is defined as an HTML collection and I have no idea why....it is a simple integer. I am sure I am missing something simple, can anyone point out what it is?

The current code is located at GitHub

1 Answers1

0
document.getElementById('the-element-id').innerHTML = 'new content';

i hope this will help

cresjie
  • 469
  • 2
  • 13
  • 1
    Even if this answer does solve the OP's problem, I would advise to use `.textContent` instead of `.innerHTML`. (I am not going to downvote you for this). The latter one has more drawbacks than the former. There are circumstances where using `.innerHMTL` is justified. Which is not the case of the circumstance that the OP has described. For more info, please check the duplicate link. – KarelG Jan 15 '18 at 08:54
  • Excellent! The issue is that I was using `.innerHTML('');` instead of `.innerHTML = '';` – Shay Connolly Jan 15 '18 at 09:26