-3

I have some code that repeat a multiple times with some checkboxes in it.

What I need is that only the first checkbox should be checked, in the example you see that all checkboxes are checked because I set so in the code, but I only need te first one to be checked.

How can I achieve that with javascript?

I've tried a couple things, but because the checkbox are inside divs I have no idea how to get this working...

enter image description here

n00bly
  • 395
  • 6
  • 21

1 Answers1

0

I didn't thought of the unique ID that each checkbox has.

So it's done with:

document.getElementById("ID_Checkbox").checked = true;
n00bly
  • 395
  • 6
  • 21