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

342
Views
can i use querrySelectorAll() to change the src value of a single attibute in multiple img elements?
  <body>

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

      <div class="dice">
        <p>Player 1</p>
        <img class="img1" src="test">
      </div>

  <div class="dice">
    <p>Player 2</p>
    <img class="img2" src="test">
  </div>

</div>

i was able to get this to work

document.querySelector(".dice img.im1, img.img2").src = "images/dice6.png"

because queryselectorAll gets copies of the elements, does that stop it from changing these values like I was able to with a regular querySelector?

and why wont this work?

document.querySelector(".dice img").src = "images/dice6.png"
about 4 years ago · Juan Pablo Isaza
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!