I'm working on a graphic interface thanks to BABYLONjs, and I've decided to implement a mode choice functionnality, meaning you can either choose edit mode or visualize mode. These 2 modes each have different HTML components, so I chose to write a construction script, which would create the HTML by implementing the right elements corresponding to the chosen mode. Let's call A.js the construction script, and B.js my main script with all my funtions.
When I'm in B.js trying to get an HTML element, like a button , which was inserted via A.js, the returned value is null (I get the element with document.getELementById('element').
I made sure to include A.js before B.js in my HTML, so I don't really understand why it doesn't work .
If you need more precisions, feel free to ask. Thanks !