Cannot Read Property 'innerhtml' Of Undefined
I'm trying to test an app in salesforce lightning component, but when I load the app (I try this app) I got the error Cannot read property 'innerHTML' of undefined The associate
Solution 1:
That just means that the element that you are looking for does not exist:
var elementNotFound = document.getElementById("noSuchId"); // Does not existconsole.log("The element:", elementNotFound);
console.log(elementNotFound.innerHTML);
As you have posted the mimified JavaScript and no HTML, I don't know how to help further then saying: Make use the ID you are using to find the element is correct and has no spelling mistakes, and that the element is actually in the HTML.
Hope this helps.
Post a Comment for "Cannot Read Property 'innerhtml' Of Undefined"