First, make sure that it is really javascript that hides your element, as it can be easily css. The easiest first step is to check the element and see if its css accidentally hides it by default.
Secondly. Is your js code in a single file or are you importing several js files to your page? If you have several js files, you can try.
Import file 1 then use javascript to display your element then import the rest of the files.
If the code that hides your element is in the first file, then your element will be visible (because you made it visible after hiding it) if the element is not displayed, this means that the hide occurs in the subsequent file. Move your javascript code showing the item after the second import, etc.
Last but not least, your code does not import external css files.
I recommend using Chrome Dev tools for any javascript debugging you do.
source share