1
I’m trying to use the document.getElementsByClassName().innerText
but it does not replace the text contained in the class.
This text comes from a php echo: echo "<div class=\"life\">$life/$maxlife</div>";
staying in html as: <div class="life">1000/6000</div>
when I use the document.getElementsByClassName("life").innerText = "outrovalor"
nothing happens. On the console it apparently worked, but on the page the information doesn’t change. What if you give to the fact that it was created in php? There’s a way around that problem?
Cool Miguel, that’s right! Thanks for the help :)
– Raizant
Glad you solved @Jacksonantunes
– Miguel