document.querySelectorAll('a:visited')
always returns empty NodeList, even if the DOM has some visited links.
I have tried it in Chrome. Is there any know bug or is it expected behavior?
While :visited
works perfectly fine if I use it in the style sheet instead of querySelectorAll.
a:visited{
color:yellow;
}
I think pseudo classes are allowed as the parameter of querySelectorAll()
.
:visited
anymore, see hacks.mozilla.org/2010/03/… – Pablo