To summarize:
This snippet of code:
for(let i = 0; i <= items.length; i++){
console.log(items[i])
}
Produces the following output:
<a class="photo ajax2" target="_blank" href="/profile/show/3209135.html" data-first="1" data-next="3206884">
<a class="photo ajax2" target="_blank" href="/profile/show/3206884.html" data-next="3209135">
<a class="photo ajax2" target="_blank" href="/profile/show/3209135.html" data-next="3209755">
I would like to extract the values of data-next
from all the links. How can I achieve this? I attempted the following code:
for(let i = 0; i <= items.length; i++){
console.log(items[i].querySelector('a["data-next"]'));
}
Unfortunately, this method did not work. I am looking for a solution using only vanilla JavaScript.
ANSWERED