panel has to be double-clicked if using external JS, but single click if script inside HTML body, don't understand

Viewed 11

Here is the code - https://www.w3schools.com/howto/howto_js_accordion.asp.

I can setup just fine in a single HTML file, but I want to move the JS code to an external file.

I make the JS code in the external file a function and an "onclick" attribute, it has to be double-clicked as an external file, don't know how to fix this? Thanks.

0 Answers
Related