0
I want to change the html content of a div, putting the 1 option of an array of elements, but when I do the following code nothing happens:
<script>
var players = ['player1', 'player2', 'player3', 'player4', 'player5', 'player6', 'player7', 'player8'];
var teste = document.getElementById('jog1');
teste.innerHTML = players[0];
</script>
<div class="player top win" id ='jog1'>
boo
</div>
When accessing index.html, instead of "boo", it should be "player1" but continues as boo. Another question, there is how I take this "boo" from the code and only ask to add 'player1' directly in the html page?
Thanks! !
– tsnotrod