I've got a script setup, the loop code is here as is the html structure
https://jsfiddle.net/OwenMelbz/mPVbE/
it basically searches the non-empty id's of the li and puts them into a csv string.
however whenever i run it it always adds an extra loop in my non-fiddle version, so I have, 9 li's, 3 contain IDs, the loop runs 4 times. Why is this?
In my non-dev version it actually picks the ID of the 1st li again and adds it. for example.
1,2,3,4,5,6,1
the 1 would be on the 1st element. no idea why this is doing it?
thanks