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

335
Views
¿Puedo usar querrySelectorAll() para cambiar el valor src de un único atributo en varios elementos img?
 <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>

pude hacer que esto funcione

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

Debido a que queryselectorAll obtiene copias de los elementos, ¿eso impide que cambie estos valores como pude con un querySelector normal?

y ¿por qué no funciona esto?

 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!