title: Append javascript variable to href folder path
body: <p>I have a javascript code that extracts filename as a variable from the current html file. </p>
  
  <pre><code>var filename=location.pathname.substring(location.pathname.lastIndexOf("/") + 1);
  console.log(filename); 
  </code></pre>
  
  <p>The filename for example is "new.html"</p>
  
  <p>I need to append this variable to a folder path with href tag for  opening another file file with that variable name in a new tab. I have tried concatenation but it doesn't work. </p>
  
  <pre><code>&lt;a href="Foldername/'+filename+'" target="_blank"&gt; 
  </code></pre>
  
  <p>Any help on this would be appreciated! Thank you!</p>
  
  <p>Edit:  I have posted the second part of my problem as another question on SO. Thank you for the help!</p>