I tried to update label with text
var label_count2 = document.createElement("label");
label_count2.setAttribute("id", "label_count2");
label_count2.style.textAlign = "right";
label_count2.style.border = "none";
gradient_div.appendChild(label_count2);
self.parent.appendChild(gradient_div);
updateText : function (text){
document.getElementById("label_count2").innerHTML = count;
},
when I tried to call to updateText() the value in the screen didn’t change.
I checked it in the debugger and I saw that the value is correct.
i tried to change the innerHTML To innerText and it also didn’t work.
If I add line label_count2.innerHTML = "any text" then I can see the value.
Could you advise me why it is not working from the function ?
This:
makes me think (though I can’t be certain) that you’re adding the element to the parent window. If that’s the case, then the
documentfrom the child window won’t contain the element, so “getElementById()” will returnnull.If that’s the case, then:
might work.