title: Dynamic path for image in JavaScript
body: <p>I'm trying to make a simple code to implement a dynamic source for a image using JavaScript, but without success.</p>
  
  <p>Coding the image path manually it works and the page shows the image.</p>
  
  <pre><code>&lt;script&gt;
  function myFunction() {
    document.getElementById("myImg").src = "data/3566.JPG";
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>But when using a variable for dynamic path it shows a X instead of the image.</p>
  
  <pre><code>&lt;script&gt;
      let ID = 3566;
  function myFunction() {
    document.getElementById("myImg").src = "data/ " + ID + ".JPG";
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I appreciate any help for checking what I'm doing wrong.</p>
  
  <p>Thanks in advance.</p>