I'm trying to change the elements in an I frame using JavaScript and it is not working! I have used it before to do this just not within an Iframe.
Console says Uncaught TypeError: Cannot read property 'textContent' of null at HTMLIFrameElement.iframe.onload
$( document ) .ready (function() {
var iframe = document.getElementById("<%= iframeID.ClientID%>");
iframe.onload = function () {
console.log("Loaded");
var doc = iframe.contentWindow.document;
console.log(doc.getElementsByClassName("fc-title"));
console.log(doc.getElementsByClassName("fc-title").item(0).textContent);
var ele = doc.getElementsByClassName("fc-title");
for (var i = 0; i < ele.length; i++) {
console.log(ele[i].textContent || ele[i].innerText);
}
}
})