querySelectorAll does not work

Asked

Viewed 36 times

0

I’m trying to pull some html tags to run my script, but I used querySelector and it didn’t work, below the code. I have several spans of this, I wonder how I solve, use the console and does not appear

<span class="buy">R$5,00<a class="select" data-ordem="3" href="#">Comprar</a></span>
const select = document.querySelectorAll(".select");
console.log(select);
  • 1

    querySelectorAll returns an array of objects, need to interact used for or foreach for example

  • look at this other question, I answered something very similar: https://answall.com/q/490925/57220

  • Thank you very much, I managed to solve the problem, it was an error in tbm file that did not run all right, but helped me a lot

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.