title: Javascript function not defined when published to Github
body: <p>I create a function that should make my div visible on click. It works fine locally, but when I publish my project on Github pages I get an error &quot;<strong>Uncaught ReferenceError: btnClick is not defined
  at HTMLElement.onclick ((index):51)</strong>&quot;. Here's the script code:</p>
  <pre><code>document.getElementById('btn-share').onclick = function btnClick() {
  
    let comma = document.getElementById('comm-share');
    let tri = document.getElementById('trio');
  
    if (comma.style.visibility === &quot;hidden&quot;) {
  
      comma.style.visibility = 'visible';
      tri.style.visibility = 'visible';
    }
    else {
      comma.style.visibility = 'hidden';
      tri.style.visibility = 'hidden';
    }
  };
  </code></pre>
  <p>Image: <a href="https://i.stack.imgur.com/G8iVf.png" rel="nofollow noreferrer">HTML</a></p>