Hello, I want to know the state of a checkbox but can't access to it because of the iframe.
And can't access via :
var iframe = hypeDocument.getElementById('iframe').children[0];
var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
I read that iframe generated by widget are not "real" iframe... If someone can help me.
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");
}
}
Also note that in looking at that inspector screenshot, it isn't clear that you really need an HTML Widget (iframe). Could you instead use a Rectangle's Inner HTML, which is represented just as a <div>?