I'm making an auto image slider and this is my html and js:
<div class="navigation-manual">
<label for="radio1"></label>
<label for="radio2"></label>
<label for="radio3"></label>
<label for="radio4"></label>
</div>
<script>
var counter=1;
setInterval(function(){
document.getElementById('radio' + counter).checked = true
counter++
if(counter>4){
counter=1
}
}, 5000)
</script>
I don't really understand why you have to add counter into "document.getElementById('radio' + counter)" like this and what does the check "checked" do...i'm just a beginner and i don't really understand the whole Javascipt. Can anyone explain it for me? Thank you so much