let inputs = userA[username].userAchkData;
inputs.forEach(function(input){
console.log(input);
document.getElementById(input.id).checked = input.checked;
});
}
Above is the relevant code; instead of setting it to checked in the HTML or like above, I actually need to simulate a .click()
on it for the real check in order to receive my data.
The above is checking the box, visually, but not actually, I need to do it via a click()
.
My console log on input
above outputs like the below, i.e.:
{id: "slz1", checked: false}
{id: "slz2", checked: true}
{id: "slz3", checked: false}
..........................
How can I rewrite in my forEach
to actually click the found checked: true
s?