Sunday, January 15, 2017

html - Failure in the querySelectorAll() from JavaScript

I'm having a problem when I try to get a element by using querySelectorAll.




Here is the part of HTML that I want to get from JS:






I'm doing this on JavaScript:




var pages = document.querySelectorAll(".pag-base a");
console.log(pages[0].textContent);


but this always returns undefined. Anyone knows what am I doing wrong?

No comments:

Post a Comment