Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
TypeError: document.getElementByClassName is not a function

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"
about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

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.

about 4 years ago ยท Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!