The relevant part of my script as mcve:
// ==UserScript==
// @name mcve
// @namespace gb
// @include https://stackoverflow.com/questions/tagged/javascript
// @version 1
// @grant none
// ==/UserScript==
// this is the one I'm really interested in: the tag entered into SE's tag editor field
let es = document.querySelectorAll('span.post-tag.rendered-element')
console.debug(es)
es = document.querySelectorAll('span.post-tag')
console.debug(es)
es = document.querySelectorAll('span.rendered-element')
console.debug(es)
The resulting output in FF's Web Console:
NodeList[ ]
NodeList[<span.post-tag>] ← Not the one I'm interested in
NodeList[ ]
If I enter the following in Firebug's search field:
span.post-tag.rendered-element→ finds the one I'm interested inspan.post-tag→ finds two, the one also found in the code above and the one I'm interested inspan.rendered-element→ finds the one I'm interested in
which is all as expected.
What am I missing here?