How to change the state of a checkbox created with createCheckbox()?


I’ve created a checkbox using box1 = createCheckbox('test', true); and I want to be able to change the state of that checkbox. However, box1.elt.checked returns undefined. This seems to be, because box1.elt returns the checkbox wrapped in a div.

 <INPUT type="checkbox" id="jxl7300rqxa"></INPUT>
 <LABEL for="jxl7300rqxa">test</LABEL>

How can I access the input div and be able to change the .checked state?

Can’t you just call method checked() over variable box1?

box1 = createCheckbox('test', true);
1 Like

Oh, that worked. Thought I tried that multiple times before, but guess I didn’t.

Thank you.