Why can't I use "document.getElementById" in catalog item's client script

Allen17
Tera Contributor

error log: TypeError: Cannot read property 'getElementById' of null,I didn't check the Isolate script

10 REPLIES 10

paulocress
Kilo Explorer

This error TypeError: document.getelementbyid(...) is null would seem to indicate that there is no such element with an ID passed to getElementById() exist. This can happen if the JavaScript code is executed before the page is fully loaded, so its not able to find the element. The solution is that you need to put your JavaScript code after the closure of the HTML element or more generally before < /body > tag.