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"
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.