title: How do I concatenate a string with a variable?
body: <p>So I am trying to make a string out of a string and a passed variable(which is a number).
  How do I do that?</p>
  
  <p>I have something like this:</p>
  
  <pre><code>function AddBorder(id){
      document.getElementById('horseThumb_'+id).className='hand positionLeft'
  }
  </code></pre>
  
  <p>So how do I get that 'horseThumb' and an id into one string?</p>
  
  <p>I tried all the various options, I also googled and besides learning that I can insert a variable in string like this <code>getElementById("horseThumb_{$id}")</code> &lt;-- (didn't work for me, I don't know why) I found nothing useful. So any help would be very appreciated.</p>