I'm trying to use document.getElementsByClassName().innerText
but it does not replace the text contained in the class.
This text comes from an echo php: echo "<div class=\"life\">$life/$maxlife</div>";
getting in the html as: <div class="life">1000/6000</div>
When I use document.getElementsByClassName("life").innerText = "outrovalor"
nothing happens. In the console apparently it worked, but in the page the information does not change. Is this due to the fact that it was created in php? Can you work around this problem?