Playground fileLabel.parentNode

I run into a file-open example in the playground (someone else created); but the script cannot load due to an error related to .parentNode. Line 40:35 - Cannot read property ‘parentNode’ of null.

https://playground.babylonjs.com/#5JBSHD#20

Can someone help take a look at it to see how to work around it? Thanks!

This is not a Babylon.js question :slight_smile:

var maintitle = document.getElementById("mainTitle");

There is no mainTitle html element in the PG so it cannot work. This PG was a hack into the old playground html structure

Understand. Thanks for the quick response.

In order to make this example working you need:

  1. Download .zip from the Playground.
  2. Put index.html into some folder on Webserver.
  3. Create in the index.html the div element with id=“mainTitle”.
  4. Put to the style .navbar {position: absolute;}
  5. Now you can see at the top over canvas the button which allows to input .babylon files into the scene.