can someone please explain me how this is happening since on the first checked it is true but how the in between are true, i mean how all the items in between the first and last check is getting checked, i don't understand the logic?
https://codepen.io/danielhoppener/pen/xxKVbey
if(checkbox === this || checkbox === lastChecked) {
inBetween = !inBetween
}
if(inBetween){ checkbox.checked = true
}
this part, i mean it will check for every input and make that checkbox check property true but here only two item is selected and then how the in between are getting selected