Sunday, 15 January 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

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...