If you need to set a checkbox element from the Ts file (TypeScript) of the component you first need to get the checkbox byId :

var element = <HTMLInputElement> document.getElementById("myCheckBoxId");

Then you can set the value by :

element.checked = false; // unchecked
element.checked = true; // checked

Laisser un commentaire