Found a solution with checkbox input inside a rectangle and with help of this thread (How to target Elements in a HTML Widget by @MarkHunte
) :
var checkButton = hypeDocument.getElementById('elementId');
checkButton.onclick = checkClic;
function checkClic(){
if (checkButton.checked == true){
console.log("true");
}else{
console.log("false");
}
}