So I'm building a multi form with tabs, however when I try to log the const:
const breadcrumbs = document.querySelectorAll('.nf-breadcrumbs li');
It returns an empty NodeList, however when I use document.querySelectorAll('.nf-breadcrumbs li');
in the console it returns the correct NodeList.
I can't figure out why it behaves like this. Any help would be greatly appreciated!
EDIT: I've added defer to the script tag, it still give me an empty Array. Async seems to return the full NodeList sometimes but not consistently.