Martin Gaens
04/22/2022, 7:55 AMList
of `HTMLDivElement`s:
val questionDivs = document.querySelectorAll("div[id^='question']").asList().map { it as HTMLDivElement }
Then, if I print it out to the console, by using console.log(questionDivs)
, it prints out just fine. If I print out the size of this List
, by using console.log(questionDivs.size)
, it prints out the size of the List
(in my case 11).
But if I try to loop over the List
by using either a foreach loop or by using the .forEach { }
method, it isn't being run not even once.
This is what gets printed out when doing `console.log(questionDivs)`:
https://paste.pics/GR0JSGrégory Lureau
04/22/2022, 10:07 AMMartin Gaens
04/22/2022, 10:12 AMMartin Gaens
04/22/2022, 10:27 AMNodeList
then?