I have the below code and the "alert" doesn't happen on click on the said element. But addEventListener seems to be supported by the IE I use (version 10) as I checked with another simple program and it worked fine.
var iframe1 = document.getElementsByName('frStatus')[0];
var innerDoc = (iframe1.contentDocument) ? iframe1.contentDocument : iframe1.contentWindow.document;
innerDoc.getElementById('slow_jquery').innerHTML = slowjquerycount;
innerDoc.getElementById('slow_jquery').style.color="red";
console.log("doc"+document.getElementById("slow_jquery"));
innerDoc.getElementById('slow_jquery').addEventListener("click", function(){
alert("event listener");
});
The corresponding html is
<span id="slow_jquery" style="cursor:pointer;color:green;">0</span>
When the above code is executed & the element is clicked, no error is thrown, no warning on console, and the alert message is not shown. Is there anything wrong with the code ? Any help is going to be of much use.
Thanks in advance.
Note: - Already tried using z-index to ensure the element is not hidden behind another. - Code works fine in Chrome. - Ensured that IE-10 supports addEventListener.