title: console.log does not work onclick event when the files are in XAMPP
body: <p>I want to display data in the <code>console.log()</code> when a button is clicked . so my code is</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  let btn = document.getElementById('myBtn');
          btn.addEventListener('click', function() {
              console.log('button clicked !!')
          })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button id="myBtn"&gt;click&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>This code works fine as expected , But When open the file from  the local host XAMPP ; the data is not displayed on the console , i tried to use <code>alert()</code> instead , it woks fine , i tried also to move the console.log('clicked!!') outside the event callback function , it woks fine also!! but as long as it is inside the function it does not work on the click event .</p>
  <p>here is a i recorder for better understanding =&gt; <a href="https://youtu.be/6xYowU8l7hM" rel="nofollow noreferrer">https://youtu.be/6xYowU8l7hM</a></p>