0

I'm trying to change the value of <p class="dice1"><p> in html via javascript, but nothing changes when I run the code.

<div class="container">
  <h1>Refresh Me</h1>

  <div class="dice">
    <p>Player 1</p>
    <img class="img1" src="">
    <p class="dice1"></p>
  </div>
</div>
<script src="dice.js" charset="utf-8"></script>
www App Brewery com
document.getElementByClassName("dice1").innerHTML = "your dice number is 6"
Đức Seven
  • 57
  • 1
  • 5

1 Answers1

1

This method doesn't return specified element, but list of elements. Try to filter list which it return to get element which u'd like to edit.